using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;

namespace csctp
{
	public class ctp_trade
	{
        private readonly List<Delegate> _listDele = new List<Delegate>();
        Delegate AddDele(Delegate d) { _listDele.Add(d); return d; }

		#region	响应函数 extern
		public delegate void DeleFrontConnected();
		/// <summary>
		/// 当客户端与交易后台建立起通信连接时（还未登录前），该方法被调用。
		/// </summary>
		public DeleFrontConnected OnFrontConnected = null;
		private void onFrontConnected()
        {
			if (OnFrontConnected == null)
            {
				return;
            }
			OnFrontConnected();
		}
		public delegate void DeleFrontDisconnected(int nReason);
		/// <summary>
		/// 当客户端与交易后台通信连接断开时，该方法被调用。当发生这个情况后，API会自动重新连接，客户端可不做处理。
		/// </summary>
		public DeleFrontDisconnected OnFrontDisconnected = null;
		private void onFrontDisconnected(int nReason)
        {
			if (OnFrontDisconnected == null)
            {
				return;
            }
			OnFrontDisconnected(nReason);
		}
		public delegate void DeleHeartBeatWarning(int nTimeLapse);
		/// <summary>
		/// 心跳超时警告。当长时间未收到报文时，该方法被调用。
		/// </summary>
		public DeleHeartBeatWarning OnHeartBeatWarning = null;
		private void onHeartBeatWarning(int nTimeLapse)
        {
			if (OnHeartBeatWarning == null)
            {
				return;
            }
			OnHeartBeatWarning(nTimeLapse);
		}
		public delegate void DeleRspAuthenticate(CThostFtdcRspAuthenticateField pRspAuthenticateField, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 客户端认证响应
		/// </summary>
		public DeleRspAuthenticate OnRspAuthenticate = null;
		private void onRspAuthenticate(IntPtr  pRspAuthenticateField, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspAuthenticate == null)
            {
				return;
            }			
			var ppRspAuthenticateField = new CThostFtdcRspAuthenticateField();
			if (pRspAuthenticateField != IntPtr.Zero)
			{
				ppRspAuthenticateField = Marshal.PtrToStructure<CThostFtdcRspAuthenticateField>(pRspAuthenticateField);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspAuthenticate(ppRspAuthenticateField, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspUserLogin(CThostFtdcRspUserLoginField pRspUserLogin, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 登录请求响应
		/// </summary>
		public DeleRspUserLogin OnRspUserLogin = null;
		private void onRspUserLogin(IntPtr  pRspUserLogin, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspUserLogin == null)
            {
				return;
            }			
			var ppRspUserLogin = new CThostFtdcRspUserLoginField();
			if (pRspUserLogin != IntPtr.Zero)
			{
				ppRspUserLogin = Marshal.PtrToStructure<CThostFtdcRspUserLoginField>(pRspUserLogin);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspUserLogin(ppRspUserLogin, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspUserLogout(CThostFtdcUserLogoutField pUserLogout, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 登出请求响应
		/// </summary>
		public DeleRspUserLogout OnRspUserLogout = null;
		private void onRspUserLogout(IntPtr  pUserLogout, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspUserLogout == null)
            {
				return;
            }			
			var ppUserLogout = new CThostFtdcUserLogoutField();
			if (pUserLogout != IntPtr.Zero)
			{
				ppUserLogout = Marshal.PtrToStructure<CThostFtdcUserLogoutField>(pUserLogout);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspUserLogout(ppUserLogout, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField pUserPasswordUpdate, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 用户口令更新请求响应
		/// </summary>
		public DeleRspUserPasswordUpdate OnRspUserPasswordUpdate = null;
		private void onRspUserPasswordUpdate(IntPtr  pUserPasswordUpdate, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspUserPasswordUpdate == null)
            {
				return;
            }			
			var ppUserPasswordUpdate = new CThostFtdcUserPasswordUpdateField();
			if (pUserPasswordUpdate != IntPtr.Zero)
			{
				ppUserPasswordUpdate = Marshal.PtrToStructure<CThostFtdcUserPasswordUpdateField>(pUserPasswordUpdate);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspUserPasswordUpdate(ppUserPasswordUpdate, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField pTradingAccountPasswordUpdate, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 资金账户口令更新请求响应
		/// </summary>
		public DeleRspTradingAccountPasswordUpdate OnRspTradingAccountPasswordUpdate = null;
		private void onRspTradingAccountPasswordUpdate(IntPtr  pTradingAccountPasswordUpdate, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspTradingAccountPasswordUpdate == null)
            {
				return;
            }			
			var ppTradingAccountPasswordUpdate = new CThostFtdcTradingAccountPasswordUpdateField();
			if (pTradingAccountPasswordUpdate != IntPtr.Zero)
			{
				ppTradingAccountPasswordUpdate = Marshal.PtrToStructure<CThostFtdcTradingAccountPasswordUpdateField>(pTradingAccountPasswordUpdate);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspTradingAccountPasswordUpdate(ppTradingAccountPasswordUpdate, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspUserAuthMethod(CThostFtdcRspUserAuthMethodField pRspUserAuthMethod, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 查询用户当前支持的认证模式的回复
		/// </summary>
		public DeleRspUserAuthMethod OnRspUserAuthMethod = null;
		private void onRspUserAuthMethod(IntPtr  pRspUserAuthMethod, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspUserAuthMethod == null)
            {
				return;
            }			
			var ppRspUserAuthMethod = new CThostFtdcRspUserAuthMethodField();
			if (pRspUserAuthMethod != IntPtr.Zero)
			{
				ppRspUserAuthMethod = Marshal.PtrToStructure<CThostFtdcRspUserAuthMethodField>(pRspUserAuthMethod);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspUserAuthMethod(ppRspUserAuthMethod, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspGenUserCaptcha(CThostFtdcRspGenUserCaptchaField pRspGenUserCaptcha, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 获取图形验证码请求的回复
		/// </summary>
		public DeleRspGenUserCaptcha OnRspGenUserCaptcha = null;
		private void onRspGenUserCaptcha(IntPtr  pRspGenUserCaptcha, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspGenUserCaptcha == null)
            {
				return;
            }			
			var ppRspGenUserCaptcha = new CThostFtdcRspGenUserCaptchaField();
			if (pRspGenUserCaptcha != IntPtr.Zero)
			{
				ppRspGenUserCaptcha = Marshal.PtrToStructure<CThostFtdcRspGenUserCaptchaField>(pRspGenUserCaptcha);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspGenUserCaptcha(ppRspGenUserCaptcha, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspGenUserText(CThostFtdcRspGenUserTextField pRspGenUserText, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 获取短信验证码请求的回复
		/// </summary>
		public DeleRspGenUserText OnRspGenUserText = null;
		private void onRspGenUserText(IntPtr  pRspGenUserText, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspGenUserText == null)
            {
				return;
            }			
			var ppRspGenUserText = new CThostFtdcRspGenUserTextField();
			if (pRspGenUserText != IntPtr.Zero)
			{
				ppRspGenUserText = Marshal.PtrToStructure<CThostFtdcRspGenUserTextField>(pRspGenUserText);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspGenUserText(ppRspGenUserText, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspOrderInsert(CThostFtdcInputOrderField pInputOrder, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 报单录入请求响应
		/// </summary>
		public DeleRspOrderInsert OnRspOrderInsert = null;
		private void onRspOrderInsert(IntPtr  pInputOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspOrderInsert == null)
            {
				return;
            }			
			var ppInputOrder = new CThostFtdcInputOrderField();
			if (pInputOrder != IntPtr.Zero)
			{
				ppInputOrder = Marshal.PtrToStructure<CThostFtdcInputOrderField>(pInputOrder);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspOrderInsert(ppInputOrder, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspParkedOrderInsert(CThostFtdcParkedOrderField pParkedOrder, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 预埋单录入请求响应
		/// </summary>
		public DeleRspParkedOrderInsert OnRspParkedOrderInsert = null;
		private void onRspParkedOrderInsert(IntPtr  pParkedOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspParkedOrderInsert == null)
            {
				return;
            }			
			var ppParkedOrder = new CThostFtdcParkedOrderField();
			if (pParkedOrder != IntPtr.Zero)
			{
				ppParkedOrder = Marshal.PtrToStructure<CThostFtdcParkedOrderField>(pParkedOrder);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspParkedOrderInsert(ppParkedOrder, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspParkedOrderAction(CThostFtdcParkedOrderActionField pParkedOrderAction, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 预埋撤单录入请求响应
		/// </summary>
		public DeleRspParkedOrderAction OnRspParkedOrderAction = null;
		private void onRspParkedOrderAction(IntPtr  pParkedOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspParkedOrderAction == null)
            {
				return;
            }			
			var ppParkedOrderAction = new CThostFtdcParkedOrderActionField();
			if (pParkedOrderAction != IntPtr.Zero)
			{
				ppParkedOrderAction = Marshal.PtrToStructure<CThostFtdcParkedOrderActionField>(pParkedOrderAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspParkedOrderAction(ppParkedOrderAction, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspOrderAction(CThostFtdcInputOrderActionField pInputOrderAction, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 报单操作请求响应
		/// </summary>
		public DeleRspOrderAction OnRspOrderAction = null;
		private void onRspOrderAction(IntPtr  pInputOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspOrderAction == null)
            {
				return;
            }			
			var ppInputOrderAction = new CThostFtdcInputOrderActionField();
			if (pInputOrderAction != IntPtr.Zero)
			{
				ppInputOrderAction = Marshal.PtrToStructure<CThostFtdcInputOrderActionField>(pInputOrderAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspOrderAction(ppInputOrderAction, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryMaxOrderVolume(CThostFtdcQryMaxOrderVolumeField pQryMaxOrderVolume, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 查询最大报单数量响应
		/// </summary>
		public DeleRspQryMaxOrderVolume OnRspQryMaxOrderVolume = null;
		private void onRspQryMaxOrderVolume(IntPtr  pQryMaxOrderVolume, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryMaxOrderVolume == null)
            {
				return;
            }			
			var ppQryMaxOrderVolume = new CThostFtdcQryMaxOrderVolumeField();
			if (pQryMaxOrderVolume != IntPtr.Zero)
			{
				ppQryMaxOrderVolume = Marshal.PtrToStructure<CThostFtdcQryMaxOrderVolumeField>(pQryMaxOrderVolume);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryMaxOrderVolume(ppQryMaxOrderVolume, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField pSettlementInfoConfirm, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 投资者结算结果确认响应
		/// </summary>
		public DeleRspSettlementInfoConfirm OnRspSettlementInfoConfirm = null;
		private void onRspSettlementInfoConfirm(IntPtr  pSettlementInfoConfirm, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspSettlementInfoConfirm == null)
            {
				return;
            }			
			var ppSettlementInfoConfirm = new CThostFtdcSettlementInfoConfirmField();
			if (pSettlementInfoConfirm != IntPtr.Zero)
			{
				ppSettlementInfoConfirm = Marshal.PtrToStructure<CThostFtdcSettlementInfoConfirmField>(pSettlementInfoConfirm);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspSettlementInfoConfirm(ppSettlementInfoConfirm, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField pRemoveParkedOrder, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 删除预埋单响应
		/// </summary>
		public DeleRspRemoveParkedOrder OnRspRemoveParkedOrder = null;
		private void onRspRemoveParkedOrder(IntPtr  pRemoveParkedOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspRemoveParkedOrder == null)
            {
				return;
            }			
			var ppRemoveParkedOrder = new CThostFtdcRemoveParkedOrderField();
			if (pRemoveParkedOrder != IntPtr.Zero)
			{
				ppRemoveParkedOrder = Marshal.PtrToStructure<CThostFtdcRemoveParkedOrderField>(pRemoveParkedOrder);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspRemoveParkedOrder(ppRemoveParkedOrder, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField pRemoveParkedOrderAction, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 删除预埋撤单响应
		/// </summary>
		public DeleRspRemoveParkedOrderAction OnRspRemoveParkedOrderAction = null;
		private void onRspRemoveParkedOrderAction(IntPtr  pRemoveParkedOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspRemoveParkedOrderAction == null)
            {
				return;
            }			
			var ppRemoveParkedOrderAction = new CThostFtdcRemoveParkedOrderActionField();
			if (pRemoveParkedOrderAction != IntPtr.Zero)
			{
				ppRemoveParkedOrderAction = Marshal.PtrToStructure<CThostFtdcRemoveParkedOrderActionField>(pRemoveParkedOrderAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspRemoveParkedOrderAction(ppRemoveParkedOrderAction, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspExecOrderInsert(CThostFtdcInputExecOrderField pInputExecOrder, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 执行宣告录入请求响应
		/// </summary>
		public DeleRspExecOrderInsert OnRspExecOrderInsert = null;
		private void onRspExecOrderInsert(IntPtr  pInputExecOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspExecOrderInsert == null)
            {
				return;
            }			
			var ppInputExecOrder = new CThostFtdcInputExecOrderField();
			if (pInputExecOrder != IntPtr.Zero)
			{
				ppInputExecOrder = Marshal.PtrToStructure<CThostFtdcInputExecOrderField>(pInputExecOrder);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspExecOrderInsert(ppInputExecOrder, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspExecOrderAction(CThostFtdcInputExecOrderActionField pInputExecOrderAction, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 执行宣告操作请求响应
		/// </summary>
		public DeleRspExecOrderAction OnRspExecOrderAction = null;
		private void onRspExecOrderAction(IntPtr  pInputExecOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspExecOrderAction == null)
            {
				return;
            }			
			var ppInputExecOrderAction = new CThostFtdcInputExecOrderActionField();
			if (pInputExecOrderAction != IntPtr.Zero)
			{
				ppInputExecOrderAction = Marshal.PtrToStructure<CThostFtdcInputExecOrderActionField>(pInputExecOrderAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspExecOrderAction(ppInputExecOrderAction, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspForQuoteInsert(CThostFtdcInputForQuoteField pInputForQuote, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 询价录入请求响应
		/// </summary>
		public DeleRspForQuoteInsert OnRspForQuoteInsert = null;
		private void onRspForQuoteInsert(IntPtr  pInputForQuote, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspForQuoteInsert == null)
            {
				return;
            }			
			var ppInputForQuote = new CThostFtdcInputForQuoteField();
			if (pInputForQuote != IntPtr.Zero)
			{
				ppInputForQuote = Marshal.PtrToStructure<CThostFtdcInputForQuoteField>(pInputForQuote);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspForQuoteInsert(ppInputForQuote, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQuoteInsert(CThostFtdcInputQuoteField pInputQuote, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 报价录入请求响应
		/// </summary>
		public DeleRspQuoteInsert OnRspQuoteInsert = null;
		private void onRspQuoteInsert(IntPtr  pInputQuote, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQuoteInsert == null)
            {
				return;
            }			
			var ppInputQuote = new CThostFtdcInputQuoteField();
			if (pInputQuote != IntPtr.Zero)
			{
				ppInputQuote = Marshal.PtrToStructure<CThostFtdcInputQuoteField>(pInputQuote);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQuoteInsert(ppInputQuote, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQuoteAction(CThostFtdcInputQuoteActionField pInputQuoteAction, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 报价操作请求响应
		/// </summary>
		public DeleRspQuoteAction OnRspQuoteAction = null;
		private void onRspQuoteAction(IntPtr  pInputQuoteAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQuoteAction == null)
            {
				return;
            }			
			var ppInputQuoteAction = new CThostFtdcInputQuoteActionField();
			if (pInputQuoteAction != IntPtr.Zero)
			{
				ppInputQuoteAction = Marshal.PtrToStructure<CThostFtdcInputQuoteActionField>(pInputQuoteAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQuoteAction(ppInputQuoteAction, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspBatchOrderAction(CThostFtdcInputBatchOrderActionField pInputBatchOrderAction, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 批量报单操作请求响应
		/// </summary>
		public DeleRspBatchOrderAction OnRspBatchOrderAction = null;
		private void onRspBatchOrderAction(IntPtr  pInputBatchOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspBatchOrderAction == null)
            {
				return;
            }			
			var ppInputBatchOrderAction = new CThostFtdcInputBatchOrderActionField();
			if (pInputBatchOrderAction != IntPtr.Zero)
			{
				ppInputBatchOrderAction = Marshal.PtrToStructure<CThostFtdcInputBatchOrderActionField>(pInputBatchOrderAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspBatchOrderAction(ppInputBatchOrderAction, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField pInputOptionSelfClose, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 期权自对冲录入请求响应
		/// </summary>
		public DeleRspOptionSelfCloseInsert OnRspOptionSelfCloseInsert = null;
		private void onRspOptionSelfCloseInsert(IntPtr  pInputOptionSelfClose, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspOptionSelfCloseInsert == null)
            {
				return;
            }			
			var ppInputOptionSelfClose = new CThostFtdcInputOptionSelfCloseField();
			if (pInputOptionSelfClose != IntPtr.Zero)
			{
				ppInputOptionSelfClose = Marshal.PtrToStructure<CThostFtdcInputOptionSelfCloseField>(pInputOptionSelfClose);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspOptionSelfCloseInsert(ppInputOptionSelfClose, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspOptionSelfCloseAction(CThostFtdcInputOptionSelfCloseActionField pInputOptionSelfCloseAction, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 期权自对冲操作请求响应
		/// </summary>
		public DeleRspOptionSelfCloseAction OnRspOptionSelfCloseAction = null;
		private void onRspOptionSelfCloseAction(IntPtr  pInputOptionSelfCloseAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspOptionSelfCloseAction == null)
            {
				return;
            }			
			var ppInputOptionSelfCloseAction = new CThostFtdcInputOptionSelfCloseActionField();
			if (pInputOptionSelfCloseAction != IntPtr.Zero)
			{
				ppInputOptionSelfCloseAction = Marshal.PtrToStructure<CThostFtdcInputOptionSelfCloseActionField>(pInputOptionSelfCloseAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspOptionSelfCloseAction(ppInputOptionSelfCloseAction, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspCombActionInsert(CThostFtdcInputCombActionField pInputCombAction, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 申请组合录入请求响应
		/// </summary>
		public DeleRspCombActionInsert OnRspCombActionInsert = null;
		private void onRspCombActionInsert(IntPtr  pInputCombAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspCombActionInsert == null)
            {
				return;
            }			
			var ppInputCombAction = new CThostFtdcInputCombActionField();
			if (pInputCombAction != IntPtr.Zero)
			{
				ppInputCombAction = Marshal.PtrToStructure<CThostFtdcInputCombActionField>(pInputCombAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspCombActionInsert(ppInputCombAction, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryOrder(CThostFtdcOrderField pOrder, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询报单响应
		/// </summary>
		public DeleRspQryOrder OnRspQryOrder = null;
		private void onRspQryOrder(IntPtr  pOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryOrder == null)
            {
				return;
            }			
			var ppOrder = new CThostFtdcOrderField();
			if (pOrder != IntPtr.Zero)
			{
				ppOrder = Marshal.PtrToStructure<CThostFtdcOrderField>(pOrder);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryOrder(ppOrder, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryTrade(CThostFtdcTradeField pTrade, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询成交响应
		/// </summary>
		public DeleRspQryTrade OnRspQryTrade = null;
		private void onRspQryTrade(IntPtr  pTrade, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryTrade == null)
            {
				return;
            }			
			var ppTrade = new CThostFtdcTradeField();
			if (pTrade != IntPtr.Zero)
			{
				ppTrade = Marshal.PtrToStructure<CThostFtdcTradeField>(pTrade);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryTrade(ppTrade, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryInvestorPosition(CThostFtdcInvestorPositionField pInvestorPosition, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询投资者持仓响应
		/// </summary>
		public DeleRspQryInvestorPosition OnRspQryInvestorPosition = null;
		private void onRspQryInvestorPosition(IntPtr  pInvestorPosition, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryInvestorPosition == null)
            {
				return;
            }			
			var ppInvestorPosition = new CThostFtdcInvestorPositionField();
			if (pInvestorPosition != IntPtr.Zero)
			{
				ppInvestorPosition = Marshal.PtrToStructure<CThostFtdcInvestorPositionField>(pInvestorPosition);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryInvestorPosition(ppInvestorPosition, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryTradingAccount(CThostFtdcTradingAccountField pTradingAccount, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询资金账户响应
		/// </summary>
		public DeleRspQryTradingAccount OnRspQryTradingAccount = null;
		private void onRspQryTradingAccount(IntPtr  pTradingAccount, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryTradingAccount == null)
            {
				return;
            }			
			var ppTradingAccount = new CThostFtdcTradingAccountField();
			if (pTradingAccount != IntPtr.Zero)
			{
				ppTradingAccount = Marshal.PtrToStructure<CThostFtdcTradingAccountField>(pTradingAccount);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryTradingAccount(ppTradingAccount, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryInvestor(CThostFtdcInvestorField pInvestor, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询投资者响应
		/// </summary>
		public DeleRspQryInvestor OnRspQryInvestor = null;
		private void onRspQryInvestor(IntPtr  pInvestor, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryInvestor == null)
            {
				return;
            }			
			var ppInvestor = new CThostFtdcInvestorField();
			if (pInvestor != IntPtr.Zero)
			{
				ppInvestor = Marshal.PtrToStructure<CThostFtdcInvestorField>(pInvestor);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryInvestor(ppInvestor, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryTradingCode(CThostFtdcTradingCodeField pTradingCode, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询交易编码响应
		/// </summary>
		public DeleRspQryTradingCode OnRspQryTradingCode = null;
		private void onRspQryTradingCode(IntPtr  pTradingCode, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryTradingCode == null)
            {
				return;
            }			
			var ppTradingCode = new CThostFtdcTradingCodeField();
			if (pTradingCode != IntPtr.Zero)
			{
				ppTradingCode = Marshal.PtrToStructure<CThostFtdcTradingCodeField>(pTradingCode);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryTradingCode(ppTradingCode, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField pInstrumentMarginRate, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询合约保证金率响应
		/// </summary>
		public DeleRspQryInstrumentMarginRate OnRspQryInstrumentMarginRate = null;
		private void onRspQryInstrumentMarginRate(IntPtr  pInstrumentMarginRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryInstrumentMarginRate == null)
            {
				return;
            }			
			var ppInstrumentMarginRate = new CThostFtdcInstrumentMarginRateField();
			if (pInstrumentMarginRate != IntPtr.Zero)
			{
				ppInstrumentMarginRate = Marshal.PtrToStructure<CThostFtdcInstrumentMarginRateField>(pInstrumentMarginRate);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryInstrumentMarginRate(ppInstrumentMarginRate, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField pInstrumentCommissionRate, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询合约手续费率响应
		/// </summary>
		public DeleRspQryInstrumentCommissionRate OnRspQryInstrumentCommissionRate = null;
		private void onRspQryInstrumentCommissionRate(IntPtr  pInstrumentCommissionRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryInstrumentCommissionRate == null)
            {
				return;
            }			
			var ppInstrumentCommissionRate = new CThostFtdcInstrumentCommissionRateField();
			if (pInstrumentCommissionRate != IntPtr.Zero)
			{
				ppInstrumentCommissionRate = Marshal.PtrToStructure<CThostFtdcInstrumentCommissionRateField>(pInstrumentCommissionRate);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryInstrumentCommissionRate(ppInstrumentCommissionRate, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryExchange(CThostFtdcExchangeField pExchange, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询交易所响应
		/// </summary>
		public DeleRspQryExchange OnRspQryExchange = null;
		private void onRspQryExchange(IntPtr  pExchange, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryExchange == null)
            {
				return;
            }			
			var ppExchange = new CThostFtdcExchangeField();
			if (pExchange != IntPtr.Zero)
			{
				ppExchange = Marshal.PtrToStructure<CThostFtdcExchangeField>(pExchange);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryExchange(ppExchange, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryProduct(CThostFtdcProductField pProduct, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询产品响应
		/// </summary>
		public DeleRspQryProduct OnRspQryProduct = null;
		private void onRspQryProduct(IntPtr  pProduct, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryProduct == null)
            {
				return;
            }			
			var ppProduct = new CThostFtdcProductField();
			if (pProduct != IntPtr.Zero)
			{
				ppProduct = Marshal.PtrToStructure<CThostFtdcProductField>(pProduct);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryProduct(ppProduct, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryInstrument(CThostFtdcInstrumentField pInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询合约响应
		/// </summary>
		public DeleRspQryInstrument OnRspQryInstrument = null;
		private void onRspQryInstrument(IntPtr  pInstrument, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryInstrument == null)
            {
				return;
            }			
			var ppInstrument = new CThostFtdcInstrumentField();
			if (pInstrument != IntPtr.Zero)
			{
				ppInstrument = Marshal.PtrToStructure<CThostFtdcInstrumentField>(pInstrument);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryInstrument(ppInstrument, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryDepthMarketData(CThostFtdcDepthMarketDataField pDepthMarketData, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询行情响应
		/// </summary>
		public DeleRspQryDepthMarketData OnRspQryDepthMarketData = null;
		private void onRspQryDepthMarketData(IntPtr  pDepthMarketData, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryDepthMarketData == null)
            {
				return;
            }			
			var ppDepthMarketData = new CThostFtdcDepthMarketDataField();
			if (pDepthMarketData != IntPtr.Zero)
			{
				ppDepthMarketData = Marshal.PtrToStructure<CThostFtdcDepthMarketDataField>(pDepthMarketData);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryDepthMarketData(ppDepthMarketData, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryTraderOffer(CThostFtdcTraderOfferField pTraderOffer, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询交易员报盘机响应
		/// </summary>
		public DeleRspQryTraderOffer OnRspQryTraderOffer = null;
		private void onRspQryTraderOffer(IntPtr  pTraderOffer, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryTraderOffer == null)
            {
				return;
            }			
			var ppTraderOffer = new CThostFtdcTraderOfferField();
			if (pTraderOffer != IntPtr.Zero)
			{
				ppTraderOffer = Marshal.PtrToStructure<CThostFtdcTraderOfferField>(pTraderOffer);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryTraderOffer(ppTraderOffer, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQrySettlementInfo(CThostFtdcSettlementInfoField pSettlementInfo, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询投资者结算结果响应
		/// </summary>
		public DeleRspQrySettlementInfo OnRspQrySettlementInfo = null;
		private void onRspQrySettlementInfo(IntPtr  pSettlementInfo, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQrySettlementInfo == null)
            {
				return;
            }			
			var ppSettlementInfo = new CThostFtdcSettlementInfoField();
			if (pSettlementInfo != IntPtr.Zero)
			{
				ppSettlementInfo = Marshal.PtrToStructure<CThostFtdcSettlementInfoField>(pSettlementInfo);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQrySettlementInfo(ppSettlementInfo, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryTransferBank(CThostFtdcTransferBankField pTransferBank, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询转帐银行响应
		/// </summary>
		public DeleRspQryTransferBank OnRspQryTransferBank = null;
		private void onRspQryTransferBank(IntPtr  pTransferBank, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryTransferBank == null)
            {
				return;
            }			
			var ppTransferBank = new CThostFtdcTransferBankField();
			if (pTransferBank != IntPtr.Zero)
			{
				ppTransferBank = Marshal.PtrToStructure<CThostFtdcTransferBankField>(pTransferBank);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryTransferBank(ppTransferBank, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField pInvestorPositionDetail, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询投资者持仓明细响应
		/// </summary>
		public DeleRspQryInvestorPositionDetail OnRspQryInvestorPositionDetail = null;
		private void onRspQryInvestorPositionDetail(IntPtr  pInvestorPositionDetail, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryInvestorPositionDetail == null)
            {
				return;
            }			
			var ppInvestorPositionDetail = new CThostFtdcInvestorPositionDetailField();
			if (pInvestorPositionDetail != IntPtr.Zero)
			{
				ppInvestorPositionDetail = Marshal.PtrToStructure<CThostFtdcInvestorPositionDetailField>(pInvestorPositionDetail);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryInvestorPositionDetail(ppInvestorPositionDetail, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryNotice(CThostFtdcNoticeField pNotice, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询客户通知响应
		/// </summary>
		public DeleRspQryNotice OnRspQryNotice = null;
		private void onRspQryNotice(IntPtr  pNotice, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryNotice == null)
            {
				return;
            }			
			var ppNotice = new CThostFtdcNoticeField();
			if (pNotice != IntPtr.Zero)
			{
				ppNotice = Marshal.PtrToStructure<CThostFtdcNoticeField>(pNotice);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryNotice(ppNotice, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField pSettlementInfoConfirm, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询结算信息确认响应
		/// </summary>
		public DeleRspQrySettlementInfoConfirm OnRspQrySettlementInfoConfirm = null;
		private void onRspQrySettlementInfoConfirm(IntPtr  pSettlementInfoConfirm, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQrySettlementInfoConfirm == null)
            {
				return;
            }			
			var ppSettlementInfoConfirm = new CThostFtdcSettlementInfoConfirmField();
			if (pSettlementInfoConfirm != IntPtr.Zero)
			{
				ppSettlementInfoConfirm = Marshal.PtrToStructure<CThostFtdcSettlementInfoConfirmField>(pSettlementInfoConfirm);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQrySettlementInfoConfirm(ppSettlementInfoConfirm, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField pInvestorPositionCombineDetail, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询投资者持仓明细响应
		/// </summary>
		public DeleRspQryInvestorPositionCombineDetail OnRspQryInvestorPositionCombineDetail = null;
		private void onRspQryInvestorPositionCombineDetail(IntPtr  pInvestorPositionCombineDetail, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryInvestorPositionCombineDetail == null)
            {
				return;
            }			
			var ppInvestorPositionCombineDetail = new CThostFtdcInvestorPositionCombineDetailField();
			if (pInvestorPositionCombineDetail != IntPtr.Zero)
			{
				ppInvestorPositionCombineDetail = Marshal.PtrToStructure<CThostFtdcInvestorPositionCombineDetailField>(pInvestorPositionCombineDetail);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryInvestorPositionCombineDetail(ppInvestorPositionCombineDetail, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField pCFMMCTradingAccountKey, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 查询保证金监管系统经纪公司资金账户密钥响应
		/// </summary>
		public DeleRspQryCFMMCTradingAccountKey OnRspQryCFMMCTradingAccountKey = null;
		private void onRspQryCFMMCTradingAccountKey(IntPtr  pCFMMCTradingAccountKey, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryCFMMCTradingAccountKey == null)
            {
				return;
            }			
			var ppCFMMCTradingAccountKey = new CThostFtdcCFMMCTradingAccountKeyField();
			if (pCFMMCTradingAccountKey != IntPtr.Zero)
			{
				ppCFMMCTradingAccountKey = Marshal.PtrToStructure<CThostFtdcCFMMCTradingAccountKeyField>(pCFMMCTradingAccountKey);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryCFMMCTradingAccountKey(ppCFMMCTradingAccountKey, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField pEWarrantOffset, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询仓单折抵信息响应
		/// </summary>
		public DeleRspQryEWarrantOffset OnRspQryEWarrantOffset = null;
		private void onRspQryEWarrantOffset(IntPtr  pEWarrantOffset, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryEWarrantOffset == null)
            {
				return;
            }			
			var ppEWarrantOffset = new CThostFtdcEWarrantOffsetField();
			if (pEWarrantOffset != IntPtr.Zero)
			{
				ppEWarrantOffset = Marshal.PtrToStructure<CThostFtdcEWarrantOffsetField>(pEWarrantOffset);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryEWarrantOffset(ppEWarrantOffset, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField pInvestorProductGroupMargin, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询投资者品种/跨品种保证金响应
		/// </summary>
		public DeleRspQryInvestorProductGroupMargin OnRspQryInvestorProductGroupMargin = null;
		private void onRspQryInvestorProductGroupMargin(IntPtr  pInvestorProductGroupMargin, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryInvestorProductGroupMargin == null)
            {
				return;
            }			
			var ppInvestorProductGroupMargin = new CThostFtdcInvestorProductGroupMarginField();
			if (pInvestorProductGroupMargin != IntPtr.Zero)
			{
				ppInvestorProductGroupMargin = Marshal.PtrToStructure<CThostFtdcInvestorProductGroupMarginField>(pInvestorProductGroupMargin);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryInvestorProductGroupMargin(ppInvestorProductGroupMargin, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField pExchangeMarginRate, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询交易所保证金率响应
		/// </summary>
		public DeleRspQryExchangeMarginRate OnRspQryExchangeMarginRate = null;
		private void onRspQryExchangeMarginRate(IntPtr  pExchangeMarginRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryExchangeMarginRate == null)
            {
				return;
            }			
			var ppExchangeMarginRate = new CThostFtdcExchangeMarginRateField();
			if (pExchangeMarginRate != IntPtr.Zero)
			{
				ppExchangeMarginRate = Marshal.PtrToStructure<CThostFtdcExchangeMarginRateField>(pExchangeMarginRate);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryExchangeMarginRate(ppExchangeMarginRate, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField pExchangeMarginRateAdjust, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询交易所调整保证金率响应
		/// </summary>
		public DeleRspQryExchangeMarginRateAdjust OnRspQryExchangeMarginRateAdjust = null;
		private void onRspQryExchangeMarginRateAdjust(IntPtr  pExchangeMarginRateAdjust, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryExchangeMarginRateAdjust == null)
            {
				return;
            }			
			var ppExchangeMarginRateAdjust = new CThostFtdcExchangeMarginRateAdjustField();
			if (pExchangeMarginRateAdjust != IntPtr.Zero)
			{
				ppExchangeMarginRateAdjust = Marshal.PtrToStructure<CThostFtdcExchangeMarginRateAdjustField>(pExchangeMarginRateAdjust);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryExchangeMarginRateAdjust(ppExchangeMarginRateAdjust, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryExchangeRate(CThostFtdcExchangeRateField pExchangeRate, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询汇率响应
		/// </summary>
		public DeleRspQryExchangeRate OnRspQryExchangeRate = null;
		private void onRspQryExchangeRate(IntPtr  pExchangeRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryExchangeRate == null)
            {
				return;
            }			
			var ppExchangeRate = new CThostFtdcExchangeRateField();
			if (pExchangeRate != IntPtr.Zero)
			{
				ppExchangeRate = Marshal.PtrToStructure<CThostFtdcExchangeRateField>(pExchangeRate);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryExchangeRate(ppExchangeRate, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField pSecAgentACIDMap, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询二级代理操作员银期权限响应
		/// </summary>
		public DeleRspQrySecAgentACIDMap OnRspQrySecAgentACIDMap = null;
		private void onRspQrySecAgentACIDMap(IntPtr  pSecAgentACIDMap, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQrySecAgentACIDMap == null)
            {
				return;
            }			
			var ppSecAgentACIDMap = new CThostFtdcSecAgentACIDMapField();
			if (pSecAgentACIDMap != IntPtr.Zero)
			{
				ppSecAgentACIDMap = Marshal.PtrToStructure<CThostFtdcSecAgentACIDMapField>(pSecAgentACIDMap);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQrySecAgentACIDMap(ppSecAgentACIDMap, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryProductExchRate(CThostFtdcProductExchRateField pProductExchRate, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询产品报价汇率
		/// </summary>
		public DeleRspQryProductExchRate OnRspQryProductExchRate = null;
		private void onRspQryProductExchRate(IntPtr  pProductExchRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryProductExchRate == null)
            {
				return;
            }			
			var ppProductExchRate = new CThostFtdcProductExchRateField();
			if (pProductExchRate != IntPtr.Zero)
			{
				ppProductExchRate = Marshal.PtrToStructure<CThostFtdcProductExchRateField>(pProductExchRate);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryProductExchRate(ppProductExchRate, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryProductGroup(CThostFtdcProductGroupField pProductGroup, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询产品组
		/// </summary>
		public DeleRspQryProductGroup OnRspQryProductGroup = null;
		private void onRspQryProductGroup(IntPtr  pProductGroup, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryProductGroup == null)
            {
				return;
            }			
			var ppProductGroup = new CThostFtdcProductGroupField();
			if (pProductGroup != IntPtr.Zero)
			{
				ppProductGroup = Marshal.PtrToStructure<CThostFtdcProductGroupField>(pProductGroup);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryProductGroup(ppProductGroup, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryMMInstrumentCommissionRate(CThostFtdcMMInstrumentCommissionRateField pMMInstrumentCommissionRate, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询做市商合约手续费率响应
		/// </summary>
		public DeleRspQryMMInstrumentCommissionRate OnRspQryMMInstrumentCommissionRate = null;
		private void onRspQryMMInstrumentCommissionRate(IntPtr  pMMInstrumentCommissionRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryMMInstrumentCommissionRate == null)
            {
				return;
            }			
			var ppMMInstrumentCommissionRate = new CThostFtdcMMInstrumentCommissionRateField();
			if (pMMInstrumentCommissionRate != IntPtr.Zero)
			{
				ppMMInstrumentCommissionRate = Marshal.PtrToStructure<CThostFtdcMMInstrumentCommissionRateField>(pMMInstrumentCommissionRate);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryMMInstrumentCommissionRate(ppMMInstrumentCommissionRate, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryMMOptionInstrCommRate(CThostFtdcMMOptionInstrCommRateField pMMOptionInstrCommRate, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询做市商期权合约手续费响应
		/// </summary>
		public DeleRspQryMMOptionInstrCommRate OnRspQryMMOptionInstrCommRate = null;
		private void onRspQryMMOptionInstrCommRate(IntPtr  pMMOptionInstrCommRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryMMOptionInstrCommRate == null)
            {
				return;
            }			
			var ppMMOptionInstrCommRate = new CThostFtdcMMOptionInstrCommRateField();
			if (pMMOptionInstrCommRate != IntPtr.Zero)
			{
				ppMMOptionInstrCommRate = Marshal.PtrToStructure<CThostFtdcMMOptionInstrCommRateField>(pMMOptionInstrCommRate);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryMMOptionInstrCommRate(ppMMOptionInstrCommRate, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryInstrumentOrderCommRate(CThostFtdcInstrumentOrderCommRateField pInstrumentOrderCommRate, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询报单手续费响应
		/// </summary>
		public DeleRspQryInstrumentOrderCommRate OnRspQryInstrumentOrderCommRate = null;
		private void onRspQryInstrumentOrderCommRate(IntPtr  pInstrumentOrderCommRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryInstrumentOrderCommRate == null)
            {
				return;
            }			
			var ppInstrumentOrderCommRate = new CThostFtdcInstrumentOrderCommRateField();
			if (pInstrumentOrderCommRate != IntPtr.Zero)
			{
				ppInstrumentOrderCommRate = Marshal.PtrToStructure<CThostFtdcInstrumentOrderCommRateField>(pInstrumentOrderCommRate);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryInstrumentOrderCommRate(ppInstrumentOrderCommRate, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQrySecAgentTradingAccount(CThostFtdcTradingAccountField pTradingAccount, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询资金账户响应
		/// </summary>
		public DeleRspQrySecAgentTradingAccount OnRspQrySecAgentTradingAccount = null;
		private void onRspQrySecAgentTradingAccount(IntPtr  pTradingAccount, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQrySecAgentTradingAccount == null)
            {
				return;
            }			
			var ppTradingAccount = new CThostFtdcTradingAccountField();
			if (pTradingAccount != IntPtr.Zero)
			{
				ppTradingAccount = Marshal.PtrToStructure<CThostFtdcTradingAccountField>(pTradingAccount);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQrySecAgentTradingAccount(ppTradingAccount, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQrySecAgentCheckMode(CThostFtdcSecAgentCheckModeField pSecAgentCheckMode, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询二级代理商资金校验模式响应
		/// </summary>
		public DeleRspQrySecAgentCheckMode OnRspQrySecAgentCheckMode = null;
		private void onRspQrySecAgentCheckMode(IntPtr  pSecAgentCheckMode, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQrySecAgentCheckMode == null)
            {
				return;
            }			
			var ppSecAgentCheckMode = new CThostFtdcSecAgentCheckModeField();
			if (pSecAgentCheckMode != IntPtr.Zero)
			{
				ppSecAgentCheckMode = Marshal.PtrToStructure<CThostFtdcSecAgentCheckModeField>(pSecAgentCheckMode);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQrySecAgentCheckMode(ppSecAgentCheckMode, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQrySecAgentTradeInfo(CThostFtdcSecAgentTradeInfoField pSecAgentTradeInfo, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询二级代理商信息响应
		/// </summary>
		public DeleRspQrySecAgentTradeInfo OnRspQrySecAgentTradeInfo = null;
		private void onRspQrySecAgentTradeInfo(IntPtr  pSecAgentTradeInfo, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQrySecAgentTradeInfo == null)
            {
				return;
            }			
			var ppSecAgentTradeInfo = new CThostFtdcSecAgentTradeInfoField();
			if (pSecAgentTradeInfo != IntPtr.Zero)
			{
				ppSecAgentTradeInfo = Marshal.PtrToStructure<CThostFtdcSecAgentTradeInfoField>(pSecAgentTradeInfo);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQrySecAgentTradeInfo(ppSecAgentTradeInfo, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField pOptionInstrTradeCost, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询期权交易成本响应
		/// </summary>
		public DeleRspQryOptionInstrTradeCost OnRspQryOptionInstrTradeCost = null;
		private void onRspQryOptionInstrTradeCost(IntPtr  pOptionInstrTradeCost, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryOptionInstrTradeCost == null)
            {
				return;
            }			
			var ppOptionInstrTradeCost = new CThostFtdcOptionInstrTradeCostField();
			if (pOptionInstrTradeCost != IntPtr.Zero)
			{
				ppOptionInstrTradeCost = Marshal.PtrToStructure<CThostFtdcOptionInstrTradeCostField>(pOptionInstrTradeCost);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryOptionInstrTradeCost(ppOptionInstrTradeCost, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField pOptionInstrCommRate, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询期权合约手续费响应
		/// </summary>
		public DeleRspQryOptionInstrCommRate OnRspQryOptionInstrCommRate = null;
		private void onRspQryOptionInstrCommRate(IntPtr  pOptionInstrCommRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryOptionInstrCommRate == null)
            {
				return;
            }			
			var ppOptionInstrCommRate = new CThostFtdcOptionInstrCommRateField();
			if (pOptionInstrCommRate != IntPtr.Zero)
			{
				ppOptionInstrCommRate = Marshal.PtrToStructure<CThostFtdcOptionInstrCommRateField>(pOptionInstrCommRate);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryOptionInstrCommRate(ppOptionInstrCommRate, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryExecOrder(CThostFtdcExecOrderField pExecOrder, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询执行宣告响应
		/// </summary>
		public DeleRspQryExecOrder OnRspQryExecOrder = null;
		private void onRspQryExecOrder(IntPtr  pExecOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryExecOrder == null)
            {
				return;
            }			
			var ppExecOrder = new CThostFtdcExecOrderField();
			if (pExecOrder != IntPtr.Zero)
			{
				ppExecOrder = Marshal.PtrToStructure<CThostFtdcExecOrderField>(pExecOrder);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryExecOrder(ppExecOrder, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryForQuote(CThostFtdcForQuoteField pForQuote, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询询价响应
		/// </summary>
		public DeleRspQryForQuote OnRspQryForQuote = null;
		private void onRspQryForQuote(IntPtr  pForQuote, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryForQuote == null)
            {
				return;
            }			
			var ppForQuote = new CThostFtdcForQuoteField();
			if (pForQuote != IntPtr.Zero)
			{
				ppForQuote = Marshal.PtrToStructure<CThostFtdcForQuoteField>(pForQuote);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryForQuote(ppForQuote, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryQuote(CThostFtdcQuoteField pQuote, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询报价响应
		/// </summary>
		public DeleRspQryQuote OnRspQryQuote = null;
		private void onRspQryQuote(IntPtr  pQuote, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryQuote == null)
            {
				return;
            }			
			var ppQuote = new CThostFtdcQuoteField();
			if (pQuote != IntPtr.Zero)
			{
				ppQuote = Marshal.PtrToStructure<CThostFtdcQuoteField>(pQuote);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryQuote(ppQuote, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryOptionSelfClose(CThostFtdcOptionSelfCloseField pOptionSelfClose, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询期权自对冲响应
		/// </summary>
		public DeleRspQryOptionSelfClose OnRspQryOptionSelfClose = null;
		private void onRspQryOptionSelfClose(IntPtr  pOptionSelfClose, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryOptionSelfClose == null)
            {
				return;
            }			
			var ppOptionSelfClose = new CThostFtdcOptionSelfCloseField();
			if (pOptionSelfClose != IntPtr.Zero)
			{
				ppOptionSelfClose = Marshal.PtrToStructure<CThostFtdcOptionSelfCloseField>(pOptionSelfClose);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryOptionSelfClose(ppOptionSelfClose, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryInvestUnit(CThostFtdcInvestUnitField pInvestUnit, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询投资单元响应
		/// </summary>
		public DeleRspQryInvestUnit OnRspQryInvestUnit = null;
		private void onRspQryInvestUnit(IntPtr  pInvestUnit, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryInvestUnit == null)
            {
				return;
            }			
			var ppInvestUnit = new CThostFtdcInvestUnitField();
			if (pInvestUnit != IntPtr.Zero)
			{
				ppInvestUnit = Marshal.PtrToStructure<CThostFtdcInvestUnitField>(pInvestUnit);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryInvestUnit(ppInvestUnit, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField pCombInstrumentGuard, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询组合合约安全系数响应
		/// </summary>
		public DeleRspQryCombInstrumentGuard OnRspQryCombInstrumentGuard = null;
		private void onRspQryCombInstrumentGuard(IntPtr  pCombInstrumentGuard, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryCombInstrumentGuard == null)
            {
				return;
            }			
			var ppCombInstrumentGuard = new CThostFtdcCombInstrumentGuardField();
			if (pCombInstrumentGuard != IntPtr.Zero)
			{
				ppCombInstrumentGuard = Marshal.PtrToStructure<CThostFtdcCombInstrumentGuardField>(pCombInstrumentGuard);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryCombInstrumentGuard(ppCombInstrumentGuard, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryCombAction(CThostFtdcCombActionField pCombAction, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询申请组合响应
		/// </summary>
		public DeleRspQryCombAction OnRspQryCombAction = null;
		private void onRspQryCombAction(IntPtr  pCombAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryCombAction == null)
            {
				return;
            }			
			var ppCombAction = new CThostFtdcCombActionField();
			if (pCombAction != IntPtr.Zero)
			{
				ppCombAction = Marshal.PtrToStructure<CThostFtdcCombActionField>(pCombAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryCombAction(ppCombAction, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryTransferSerial(CThostFtdcTransferSerialField pTransferSerial, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询转帐流水响应
		/// </summary>
		public DeleRspQryTransferSerial OnRspQryTransferSerial = null;
		private void onRspQryTransferSerial(IntPtr  pTransferSerial, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryTransferSerial == null)
            {
				return;
            }			
			var ppTransferSerial = new CThostFtdcTransferSerialField();
			if (pTransferSerial != IntPtr.Zero)
			{
				ppTransferSerial = Marshal.PtrToStructure<CThostFtdcTransferSerialField>(pTransferSerial);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryTransferSerial(ppTransferSerial, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryAccountregister(CThostFtdcAccountregisterField pAccountregister, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询银期签约关系响应
		/// </summary>
		public DeleRspQryAccountregister OnRspQryAccountregister = null;
		private void onRspQryAccountregister(IntPtr  pAccountregister, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryAccountregister == null)
            {
				return;
            }			
			var ppAccountregister = new CThostFtdcAccountregisterField();
			if (pAccountregister != IntPtr.Zero)
			{
				ppAccountregister = Marshal.PtrToStructure<CThostFtdcAccountregisterField>(pAccountregister);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryAccountregister(ppAccountregister, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspError(CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 错误应答
		/// </summary>
		public DeleRspError OnRspError = null;
		private void onRspError(IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspError == null)
            {
				return;
            }			
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspError(ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRtnOrder(CThostFtdcOrderField pOrder);
		/// <summary>
		/// 报单通知
		/// </summary>
		public DeleRtnOrder OnRtnOrder = null;
		private void onRtnOrder(IntPtr  pOrder)
        {
			if (OnRtnOrder == null)
            {
				return;
            }			
			var ppOrder = new CThostFtdcOrderField();
			if (pOrder != IntPtr.Zero)
			{
				ppOrder = Marshal.PtrToStructure<CThostFtdcOrderField>(pOrder);
			}
			
			OnRtnOrder(ppOrder);
		}
		public delegate void DeleRtnTrade(CThostFtdcTradeField pTrade);
		/// <summary>
		/// 成交通知
		/// </summary>
		public DeleRtnTrade OnRtnTrade = null;
		private void onRtnTrade(IntPtr  pTrade)
        {
			if (OnRtnTrade == null)
            {
				return;
            }			
			var ppTrade = new CThostFtdcTradeField();
			if (pTrade != IntPtr.Zero)
			{
				ppTrade = Marshal.PtrToStructure<CThostFtdcTradeField>(pTrade);
			}
			
			OnRtnTrade(ppTrade);
		}
		public delegate void DeleErrRtnOrderInsert(CThostFtdcInputOrderField pInputOrder, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 报单录入错误回报
		/// </summary>
		public DeleErrRtnOrderInsert OnErrRtnOrderInsert = null;
		private void onErrRtnOrderInsert(IntPtr  pInputOrder, IntPtr  pRspInfo)
        {
			if (OnErrRtnOrderInsert == null)
            {
				return;
            }			
			var ppInputOrder = new CThostFtdcInputOrderField();
			if (pInputOrder != IntPtr.Zero)
			{
				ppInputOrder = Marshal.PtrToStructure<CThostFtdcInputOrderField>(pInputOrder);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnOrderInsert(ppInputOrder, ppRspInfo);
		}
		public delegate void DeleErrRtnOrderAction(CThostFtdcOrderActionField pOrderAction, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 报单操作错误回报
		/// </summary>
		public DeleErrRtnOrderAction OnErrRtnOrderAction = null;
		private void onErrRtnOrderAction(IntPtr  pOrderAction, IntPtr  pRspInfo)
        {
			if (OnErrRtnOrderAction == null)
            {
				return;
            }			
			var ppOrderAction = new CThostFtdcOrderActionField();
			if (pOrderAction != IntPtr.Zero)
			{
				ppOrderAction = Marshal.PtrToStructure<CThostFtdcOrderActionField>(pOrderAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnOrderAction(ppOrderAction, ppRspInfo);
		}
		public delegate void DeleRtnInstrumentStatus(CThostFtdcInstrumentStatusField pInstrumentStatus);
		/// <summary>
		/// 合约交易状态通知
		/// </summary>
		public DeleRtnInstrumentStatus OnRtnInstrumentStatus = null;
		private void onRtnInstrumentStatus(IntPtr  pInstrumentStatus)
        {
			if (OnRtnInstrumentStatus == null)
            {
				return;
            }			
			var ppInstrumentStatus = new CThostFtdcInstrumentStatusField();
			if (pInstrumentStatus != IntPtr.Zero)
			{
				ppInstrumentStatus = Marshal.PtrToStructure<CThostFtdcInstrumentStatusField>(pInstrumentStatus);
			}
			
			OnRtnInstrumentStatus(ppInstrumentStatus);
		}
		public delegate void DeleRtnBulletin(CThostFtdcBulletinField pBulletin);
		/// <summary>
		/// 交易所公告通知
		/// </summary>
		public DeleRtnBulletin OnRtnBulletin = null;
		private void onRtnBulletin(IntPtr  pBulletin)
        {
			if (OnRtnBulletin == null)
            {
				return;
            }			
			var ppBulletin = new CThostFtdcBulletinField();
			if (pBulletin != IntPtr.Zero)
			{
				ppBulletin = Marshal.PtrToStructure<CThostFtdcBulletinField>(pBulletin);
			}
			
			OnRtnBulletin(ppBulletin);
		}
		public delegate void DeleRtnTradingNotice(CThostFtdcTradingNoticeInfoField pTradingNoticeInfo);
		/// <summary>
		/// 交易通知
		/// </summary>
		public DeleRtnTradingNotice OnRtnTradingNotice = null;
		private void onRtnTradingNotice(IntPtr  pTradingNoticeInfo)
        {
			if (OnRtnTradingNotice == null)
            {
				return;
            }			
			var ppTradingNoticeInfo = new CThostFtdcTradingNoticeInfoField();
			if (pTradingNoticeInfo != IntPtr.Zero)
			{
				ppTradingNoticeInfo = Marshal.PtrToStructure<CThostFtdcTradingNoticeInfoField>(pTradingNoticeInfo);
			}
			
			OnRtnTradingNotice(ppTradingNoticeInfo);
		}
		public delegate void DeleRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField pErrorConditionalOrder);
		/// <summary>
		/// 提示条件单校验错误
		/// </summary>
		public DeleRtnErrorConditionalOrder OnRtnErrorConditionalOrder = null;
		private void onRtnErrorConditionalOrder(IntPtr  pErrorConditionalOrder)
        {
			if (OnRtnErrorConditionalOrder == null)
            {
				return;
            }			
			var ppErrorConditionalOrder = new CThostFtdcErrorConditionalOrderField();
			if (pErrorConditionalOrder != IntPtr.Zero)
			{
				ppErrorConditionalOrder = Marshal.PtrToStructure<CThostFtdcErrorConditionalOrderField>(pErrorConditionalOrder);
			}
			
			OnRtnErrorConditionalOrder(ppErrorConditionalOrder);
		}
		public delegate void DeleRtnExecOrder(CThostFtdcExecOrderField pExecOrder);
		/// <summary>
		/// 执行宣告通知
		/// </summary>
		public DeleRtnExecOrder OnRtnExecOrder = null;
		private void onRtnExecOrder(IntPtr  pExecOrder)
        {
			if (OnRtnExecOrder == null)
            {
				return;
            }			
			var ppExecOrder = new CThostFtdcExecOrderField();
			if (pExecOrder != IntPtr.Zero)
			{
				ppExecOrder = Marshal.PtrToStructure<CThostFtdcExecOrderField>(pExecOrder);
			}
			
			OnRtnExecOrder(ppExecOrder);
		}
		public delegate void DeleErrRtnExecOrderInsert(CThostFtdcInputExecOrderField pInputExecOrder, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 执行宣告录入错误回报
		/// </summary>
		public DeleErrRtnExecOrderInsert OnErrRtnExecOrderInsert = null;
		private void onErrRtnExecOrderInsert(IntPtr  pInputExecOrder, IntPtr  pRspInfo)
        {
			if (OnErrRtnExecOrderInsert == null)
            {
				return;
            }			
			var ppInputExecOrder = new CThostFtdcInputExecOrderField();
			if (pInputExecOrder != IntPtr.Zero)
			{
				ppInputExecOrder = Marshal.PtrToStructure<CThostFtdcInputExecOrderField>(pInputExecOrder);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnExecOrderInsert(ppInputExecOrder, ppRspInfo);
		}
		public delegate void DeleErrRtnExecOrderAction(CThostFtdcExecOrderActionField pExecOrderAction, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 执行宣告操作错误回报
		/// </summary>
		public DeleErrRtnExecOrderAction OnErrRtnExecOrderAction = null;
		private void onErrRtnExecOrderAction(IntPtr  pExecOrderAction, IntPtr  pRspInfo)
        {
			if (OnErrRtnExecOrderAction == null)
            {
				return;
            }			
			var ppExecOrderAction = new CThostFtdcExecOrderActionField();
			if (pExecOrderAction != IntPtr.Zero)
			{
				ppExecOrderAction = Marshal.PtrToStructure<CThostFtdcExecOrderActionField>(pExecOrderAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnExecOrderAction(ppExecOrderAction, ppRspInfo);
		}
		public delegate void DeleErrRtnForQuoteInsert(CThostFtdcInputForQuoteField pInputForQuote, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 询价录入错误回报
		/// </summary>
		public DeleErrRtnForQuoteInsert OnErrRtnForQuoteInsert = null;
		private void onErrRtnForQuoteInsert(IntPtr  pInputForQuote, IntPtr  pRspInfo)
        {
			if (OnErrRtnForQuoteInsert == null)
            {
				return;
            }			
			var ppInputForQuote = new CThostFtdcInputForQuoteField();
			if (pInputForQuote != IntPtr.Zero)
			{
				ppInputForQuote = Marshal.PtrToStructure<CThostFtdcInputForQuoteField>(pInputForQuote);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnForQuoteInsert(ppInputForQuote, ppRspInfo);
		}
		public delegate void DeleRtnQuote(CThostFtdcQuoteField pQuote);
		/// <summary>
		/// 报价通知
		/// </summary>
		public DeleRtnQuote OnRtnQuote = null;
		private void onRtnQuote(IntPtr  pQuote)
        {
			if (OnRtnQuote == null)
            {
				return;
            }			
			var ppQuote = new CThostFtdcQuoteField();
			if (pQuote != IntPtr.Zero)
			{
				ppQuote = Marshal.PtrToStructure<CThostFtdcQuoteField>(pQuote);
			}
			
			OnRtnQuote(ppQuote);
		}
		public delegate void DeleErrRtnQuoteInsert(CThostFtdcInputQuoteField pInputQuote, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 报价录入错误回报
		/// </summary>
		public DeleErrRtnQuoteInsert OnErrRtnQuoteInsert = null;
		private void onErrRtnQuoteInsert(IntPtr  pInputQuote, IntPtr  pRspInfo)
        {
			if (OnErrRtnQuoteInsert == null)
            {
				return;
            }			
			var ppInputQuote = new CThostFtdcInputQuoteField();
			if (pInputQuote != IntPtr.Zero)
			{
				ppInputQuote = Marshal.PtrToStructure<CThostFtdcInputQuoteField>(pInputQuote);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnQuoteInsert(ppInputQuote, ppRspInfo);
		}
		public delegate void DeleErrRtnQuoteAction(CThostFtdcQuoteActionField pQuoteAction, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 报价操作错误回报
		/// </summary>
		public DeleErrRtnQuoteAction OnErrRtnQuoteAction = null;
		private void onErrRtnQuoteAction(IntPtr  pQuoteAction, IntPtr  pRspInfo)
        {
			if (OnErrRtnQuoteAction == null)
            {
				return;
            }			
			var ppQuoteAction = new CThostFtdcQuoteActionField();
			if (pQuoteAction != IntPtr.Zero)
			{
				ppQuoteAction = Marshal.PtrToStructure<CThostFtdcQuoteActionField>(pQuoteAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnQuoteAction(ppQuoteAction, ppRspInfo);
		}
		public delegate void DeleRtnForQuoteRsp(CThostFtdcForQuoteRspField pForQuoteRsp);
		/// <summary>
		/// 询价通知
		/// </summary>
		public DeleRtnForQuoteRsp OnRtnForQuoteRsp = null;
		private void onRtnForQuoteRsp(IntPtr  pForQuoteRsp)
        {
			if (OnRtnForQuoteRsp == null)
            {
				return;
            }			
			var ppForQuoteRsp = new CThostFtdcForQuoteRspField();
			if (pForQuoteRsp != IntPtr.Zero)
			{
				ppForQuoteRsp = Marshal.PtrToStructure<CThostFtdcForQuoteRspField>(pForQuoteRsp);
			}
			
			OnRtnForQuoteRsp(ppForQuoteRsp);
		}
		public delegate void DeleRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField pCFMMCTradingAccountToken);
		/// <summary>
		/// 保证金监控中心用户令牌
		/// </summary>
		public DeleRtnCFMMCTradingAccountToken OnRtnCFMMCTradingAccountToken = null;
		private void onRtnCFMMCTradingAccountToken(IntPtr  pCFMMCTradingAccountToken)
        {
			if (OnRtnCFMMCTradingAccountToken == null)
            {
				return;
            }			
			var ppCFMMCTradingAccountToken = new CThostFtdcCFMMCTradingAccountTokenField();
			if (pCFMMCTradingAccountToken != IntPtr.Zero)
			{
				ppCFMMCTradingAccountToken = Marshal.PtrToStructure<CThostFtdcCFMMCTradingAccountTokenField>(pCFMMCTradingAccountToken);
			}
			
			OnRtnCFMMCTradingAccountToken(ppCFMMCTradingAccountToken);
		}
		public delegate void DeleErrRtnBatchOrderAction(CThostFtdcBatchOrderActionField pBatchOrderAction, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 批量报单操作错误回报
		/// </summary>
		public DeleErrRtnBatchOrderAction OnErrRtnBatchOrderAction = null;
		private void onErrRtnBatchOrderAction(IntPtr  pBatchOrderAction, IntPtr  pRspInfo)
        {
			if (OnErrRtnBatchOrderAction == null)
            {
				return;
            }			
			var ppBatchOrderAction = new CThostFtdcBatchOrderActionField();
			if (pBatchOrderAction != IntPtr.Zero)
			{
				ppBatchOrderAction = Marshal.PtrToStructure<CThostFtdcBatchOrderActionField>(pBatchOrderAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnBatchOrderAction(ppBatchOrderAction, ppRspInfo);
		}
		public delegate void DeleRtnOptionSelfClose(CThostFtdcOptionSelfCloseField pOptionSelfClose);
		/// <summary>
		/// 期权自对冲通知
		/// </summary>
		public DeleRtnOptionSelfClose OnRtnOptionSelfClose = null;
		private void onRtnOptionSelfClose(IntPtr  pOptionSelfClose)
        {
			if (OnRtnOptionSelfClose == null)
            {
				return;
            }			
			var ppOptionSelfClose = new CThostFtdcOptionSelfCloseField();
			if (pOptionSelfClose != IntPtr.Zero)
			{
				ppOptionSelfClose = Marshal.PtrToStructure<CThostFtdcOptionSelfCloseField>(pOptionSelfClose);
			}
			
			OnRtnOptionSelfClose(ppOptionSelfClose);
		}
		public delegate void DeleErrRtnOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField pInputOptionSelfClose, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 期权自对冲录入错误回报
		/// </summary>
		public DeleErrRtnOptionSelfCloseInsert OnErrRtnOptionSelfCloseInsert = null;
		private void onErrRtnOptionSelfCloseInsert(IntPtr  pInputOptionSelfClose, IntPtr  pRspInfo)
        {
			if (OnErrRtnOptionSelfCloseInsert == null)
            {
				return;
            }			
			var ppInputOptionSelfClose = new CThostFtdcInputOptionSelfCloseField();
			if (pInputOptionSelfClose != IntPtr.Zero)
			{
				ppInputOptionSelfClose = Marshal.PtrToStructure<CThostFtdcInputOptionSelfCloseField>(pInputOptionSelfClose);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnOptionSelfCloseInsert(ppInputOptionSelfClose, ppRspInfo);
		}
		public delegate void DeleErrRtnOptionSelfCloseAction(CThostFtdcOptionSelfCloseActionField pOptionSelfCloseAction, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 期权自对冲操作错误回报
		/// </summary>
		public DeleErrRtnOptionSelfCloseAction OnErrRtnOptionSelfCloseAction = null;
		private void onErrRtnOptionSelfCloseAction(IntPtr  pOptionSelfCloseAction, IntPtr  pRspInfo)
        {
			if (OnErrRtnOptionSelfCloseAction == null)
            {
				return;
            }			
			var ppOptionSelfCloseAction = new CThostFtdcOptionSelfCloseActionField();
			if (pOptionSelfCloseAction != IntPtr.Zero)
			{
				ppOptionSelfCloseAction = Marshal.PtrToStructure<CThostFtdcOptionSelfCloseActionField>(pOptionSelfCloseAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnOptionSelfCloseAction(ppOptionSelfCloseAction, ppRspInfo);
		}
		public delegate void DeleRtnCombAction(CThostFtdcCombActionField pCombAction);
		/// <summary>
		/// 申请组合通知
		/// </summary>
		public DeleRtnCombAction OnRtnCombAction = null;
		private void onRtnCombAction(IntPtr  pCombAction)
        {
			if (OnRtnCombAction == null)
            {
				return;
            }			
			var ppCombAction = new CThostFtdcCombActionField();
			if (pCombAction != IntPtr.Zero)
			{
				ppCombAction = Marshal.PtrToStructure<CThostFtdcCombActionField>(pCombAction);
			}
			
			OnRtnCombAction(ppCombAction);
		}
		public delegate void DeleErrRtnCombActionInsert(CThostFtdcInputCombActionField pInputCombAction, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 申请组合录入错误回报
		/// </summary>
		public DeleErrRtnCombActionInsert OnErrRtnCombActionInsert = null;
		private void onErrRtnCombActionInsert(IntPtr  pInputCombAction, IntPtr  pRspInfo)
        {
			if (OnErrRtnCombActionInsert == null)
            {
				return;
            }			
			var ppInputCombAction = new CThostFtdcInputCombActionField();
			if (pInputCombAction != IntPtr.Zero)
			{
				ppInputCombAction = Marshal.PtrToStructure<CThostFtdcInputCombActionField>(pInputCombAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnCombActionInsert(ppInputCombAction, ppRspInfo);
		}
		public delegate void DeleRspQryContractBank(CThostFtdcContractBankField pContractBank, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询签约银行响应
		/// </summary>
		public DeleRspQryContractBank OnRspQryContractBank = null;
		private void onRspQryContractBank(IntPtr  pContractBank, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryContractBank == null)
            {
				return;
            }			
			var ppContractBank = new CThostFtdcContractBankField();
			if (pContractBank != IntPtr.Zero)
			{
				ppContractBank = Marshal.PtrToStructure<CThostFtdcContractBankField>(pContractBank);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryContractBank(ppContractBank, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryParkedOrder(CThostFtdcParkedOrderField pParkedOrder, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询预埋单响应
		/// </summary>
		public DeleRspQryParkedOrder OnRspQryParkedOrder = null;
		private void onRspQryParkedOrder(IntPtr  pParkedOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryParkedOrder == null)
            {
				return;
            }			
			var ppParkedOrder = new CThostFtdcParkedOrderField();
			if (pParkedOrder != IntPtr.Zero)
			{
				ppParkedOrder = Marshal.PtrToStructure<CThostFtdcParkedOrderField>(pParkedOrder);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryParkedOrder(ppParkedOrder, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryParkedOrderAction(CThostFtdcParkedOrderActionField pParkedOrderAction, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询预埋撤单响应
		/// </summary>
		public DeleRspQryParkedOrderAction OnRspQryParkedOrderAction = null;
		private void onRspQryParkedOrderAction(IntPtr  pParkedOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryParkedOrderAction == null)
            {
				return;
            }			
			var ppParkedOrderAction = new CThostFtdcParkedOrderActionField();
			if (pParkedOrderAction != IntPtr.Zero)
			{
				ppParkedOrderAction = Marshal.PtrToStructure<CThostFtdcParkedOrderActionField>(pParkedOrderAction);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryParkedOrderAction(ppParkedOrderAction, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryTradingNotice(CThostFtdcTradingNoticeField pTradingNotice, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询交易通知响应
		/// </summary>
		public DeleRspQryTradingNotice OnRspQryTradingNotice = null;
		private void onRspQryTradingNotice(IntPtr  pTradingNotice, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryTradingNotice == null)
            {
				return;
            }			
			var ppTradingNotice = new CThostFtdcTradingNoticeField();
			if (pTradingNotice != IntPtr.Zero)
			{
				ppTradingNotice = Marshal.PtrToStructure<CThostFtdcTradingNoticeField>(pTradingNotice);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryTradingNotice(ppTradingNotice, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField pBrokerTradingParams, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询经纪公司交易参数响应
		/// </summary>
		public DeleRspQryBrokerTradingParams OnRspQryBrokerTradingParams = null;
		private void onRspQryBrokerTradingParams(IntPtr  pBrokerTradingParams, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryBrokerTradingParams == null)
            {
				return;
            }			
			var ppBrokerTradingParams = new CThostFtdcBrokerTradingParamsField();
			if (pBrokerTradingParams != IntPtr.Zero)
			{
				ppBrokerTradingParams = Marshal.PtrToStructure<CThostFtdcBrokerTradingParamsField>(pBrokerTradingParams);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryBrokerTradingParams(ppBrokerTradingParams, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField pBrokerTradingAlgos, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询经纪公司交易算法响应
		/// </summary>
		public DeleRspQryBrokerTradingAlgos OnRspQryBrokerTradingAlgos = null;
		private void onRspQryBrokerTradingAlgos(IntPtr  pBrokerTradingAlgos, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryBrokerTradingAlgos == null)
            {
				return;
            }			
			var ppBrokerTradingAlgos = new CThostFtdcBrokerTradingAlgosField();
			if (pBrokerTradingAlgos != IntPtr.Zero)
			{
				ppBrokerTradingAlgos = Marshal.PtrToStructure<CThostFtdcBrokerTradingAlgosField>(pBrokerTradingAlgos);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryBrokerTradingAlgos(ppBrokerTradingAlgos, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询监控中心用户令牌
		/// </summary>
		public DeleRspQueryCFMMCTradingAccountToken OnRspQueryCFMMCTradingAccountToken = null;
		private void onRspQueryCFMMCTradingAccountToken(IntPtr  pQueryCFMMCTradingAccountToken, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQueryCFMMCTradingAccountToken == null)
            {
				return;
            }			
			var ppQueryCFMMCTradingAccountToken = new CThostFtdcQueryCFMMCTradingAccountTokenField();
			if (pQueryCFMMCTradingAccountToken != IntPtr.Zero)
			{
				ppQueryCFMMCTradingAccountToken = Marshal.PtrToStructure<CThostFtdcQueryCFMMCTradingAccountTokenField>(pQueryCFMMCTradingAccountToken);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQueryCFMMCTradingAccountToken(ppQueryCFMMCTradingAccountToken, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRtnFromBankToFutureByBank(CThostFtdcRspTransferField pRspTransfer);
		/// <summary>
		/// 银行发起银行资金转期货通知
		/// </summary>
		public DeleRtnFromBankToFutureByBank OnRtnFromBankToFutureByBank = null;
		private void onRtnFromBankToFutureByBank(IntPtr  pRspTransfer)
        {
			if (OnRtnFromBankToFutureByBank == null)
            {
				return;
            }			
			var ppRspTransfer = new CThostFtdcRspTransferField();
			if (pRspTransfer != IntPtr.Zero)
			{
				ppRspTransfer = Marshal.PtrToStructure<CThostFtdcRspTransferField>(pRspTransfer);
			}
			
			OnRtnFromBankToFutureByBank(ppRspTransfer);
		}
		public delegate void DeleRtnFromFutureToBankByBank(CThostFtdcRspTransferField pRspTransfer);
		/// <summary>
		/// 银行发起期货资金转银行通知
		/// </summary>
		public DeleRtnFromFutureToBankByBank OnRtnFromFutureToBankByBank = null;
		private void onRtnFromFutureToBankByBank(IntPtr  pRspTransfer)
        {
			if (OnRtnFromFutureToBankByBank == null)
            {
				return;
            }			
			var ppRspTransfer = new CThostFtdcRspTransferField();
			if (pRspTransfer != IntPtr.Zero)
			{
				ppRspTransfer = Marshal.PtrToStructure<CThostFtdcRspTransferField>(pRspTransfer);
			}
			
			OnRtnFromFutureToBankByBank(ppRspTransfer);
		}
		public delegate void DeleRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField pRspRepeal);
		/// <summary>
		/// 银行发起冲正银行转期货通知
		/// </summary>
		public DeleRtnRepealFromBankToFutureByBank OnRtnRepealFromBankToFutureByBank = null;
		private void onRtnRepealFromBankToFutureByBank(IntPtr  pRspRepeal)
        {
			if (OnRtnRepealFromBankToFutureByBank == null)
            {
				return;
            }			
			var ppRspRepeal = new CThostFtdcRspRepealField();
			if (pRspRepeal != IntPtr.Zero)
			{
				ppRspRepeal = Marshal.PtrToStructure<CThostFtdcRspRepealField>(pRspRepeal);
			}
			
			OnRtnRepealFromBankToFutureByBank(ppRspRepeal);
		}
		public delegate void DeleRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField pRspRepeal);
		/// <summary>
		/// 银行发起冲正期货转银行通知
		/// </summary>
		public DeleRtnRepealFromFutureToBankByBank OnRtnRepealFromFutureToBankByBank = null;
		private void onRtnRepealFromFutureToBankByBank(IntPtr  pRspRepeal)
        {
			if (OnRtnRepealFromFutureToBankByBank == null)
            {
				return;
            }			
			var ppRspRepeal = new CThostFtdcRspRepealField();
			if (pRspRepeal != IntPtr.Zero)
			{
				ppRspRepeal = Marshal.PtrToStructure<CThostFtdcRspRepealField>(pRspRepeal);
			}
			
			OnRtnRepealFromFutureToBankByBank(ppRspRepeal);
		}
		public delegate void DeleRtnFromBankToFutureByFuture(CThostFtdcRspTransferField pRspTransfer);
		/// <summary>
		/// 期货发起银行资金转期货通知
		/// </summary>
		public DeleRtnFromBankToFutureByFuture OnRtnFromBankToFutureByFuture = null;
		private void onRtnFromBankToFutureByFuture(IntPtr  pRspTransfer)
        {
			if (OnRtnFromBankToFutureByFuture == null)
            {
				return;
            }			
			var ppRspTransfer = new CThostFtdcRspTransferField();
			if (pRspTransfer != IntPtr.Zero)
			{
				ppRspTransfer = Marshal.PtrToStructure<CThostFtdcRspTransferField>(pRspTransfer);
			}
			
			OnRtnFromBankToFutureByFuture(ppRspTransfer);
		}
		public delegate void DeleRtnFromFutureToBankByFuture(CThostFtdcRspTransferField pRspTransfer);
		/// <summary>
		/// 期货发起期货资金转银行通知
		/// </summary>
		public DeleRtnFromFutureToBankByFuture OnRtnFromFutureToBankByFuture = null;
		private void onRtnFromFutureToBankByFuture(IntPtr  pRspTransfer)
        {
			if (OnRtnFromFutureToBankByFuture == null)
            {
				return;
            }			
			var ppRspTransfer = new CThostFtdcRspTransferField();
			if (pRspTransfer != IntPtr.Zero)
			{
				ppRspTransfer = Marshal.PtrToStructure<CThostFtdcRspTransferField>(pRspTransfer);
			}
			
			OnRtnFromFutureToBankByFuture(ppRspTransfer);
		}
		public delegate void DeleRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField pRspRepeal);
		/// <summary>
		/// 系统运行时期货端手工发起冲正银行转期货请求，银行处理完毕后报盘发回的通知
		/// </summary>
		public DeleRtnRepealFromBankToFutureByFutureManual OnRtnRepealFromBankToFutureByFutureManual = null;
		private void onRtnRepealFromBankToFutureByFutureManual(IntPtr  pRspRepeal)
        {
			if (OnRtnRepealFromBankToFutureByFutureManual == null)
            {
				return;
            }			
			var ppRspRepeal = new CThostFtdcRspRepealField();
			if (pRspRepeal != IntPtr.Zero)
			{
				ppRspRepeal = Marshal.PtrToStructure<CThostFtdcRspRepealField>(pRspRepeal);
			}
			
			OnRtnRepealFromBankToFutureByFutureManual(ppRspRepeal);
		}
		public delegate void DeleRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField pRspRepeal);
		/// <summary>
		/// 系统运行时期货端手工发起冲正期货转银行请求，银行处理完毕后报盘发回的通知
		/// </summary>
		public DeleRtnRepealFromFutureToBankByFutureManual OnRtnRepealFromFutureToBankByFutureManual = null;
		private void onRtnRepealFromFutureToBankByFutureManual(IntPtr  pRspRepeal)
        {
			if (OnRtnRepealFromFutureToBankByFutureManual == null)
            {
				return;
            }			
			var ppRspRepeal = new CThostFtdcRspRepealField();
			if (pRspRepeal != IntPtr.Zero)
			{
				ppRspRepeal = Marshal.PtrToStructure<CThostFtdcRspRepealField>(pRspRepeal);
			}
			
			OnRtnRepealFromFutureToBankByFutureManual(ppRspRepeal);
		}
		public delegate void DeleRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField pNotifyQueryAccount);
		/// <summary>
		/// 期货发起查询银行余额通知
		/// </summary>
		public DeleRtnQueryBankBalanceByFuture OnRtnQueryBankBalanceByFuture = null;
		private void onRtnQueryBankBalanceByFuture(IntPtr  pNotifyQueryAccount)
        {
			if (OnRtnQueryBankBalanceByFuture == null)
            {
				return;
            }			
			var ppNotifyQueryAccount = new CThostFtdcNotifyQueryAccountField();
			if (pNotifyQueryAccount != IntPtr.Zero)
			{
				ppNotifyQueryAccount = Marshal.PtrToStructure<CThostFtdcNotifyQueryAccountField>(pNotifyQueryAccount);
			}
			
			OnRtnQueryBankBalanceByFuture(ppNotifyQueryAccount);
		}
		public delegate void DeleErrRtnBankToFutureByFuture(CThostFtdcReqTransferField pReqTransfer, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 期货发起银行资金转期货错误回报
		/// </summary>
		public DeleErrRtnBankToFutureByFuture OnErrRtnBankToFutureByFuture = null;
		private void onErrRtnBankToFutureByFuture(IntPtr  pReqTransfer, IntPtr  pRspInfo)
        {
			if (OnErrRtnBankToFutureByFuture == null)
            {
				return;
            }			
			var ppReqTransfer = new CThostFtdcReqTransferField();
			if (pReqTransfer != IntPtr.Zero)
			{
				ppReqTransfer = Marshal.PtrToStructure<CThostFtdcReqTransferField>(pReqTransfer);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnBankToFutureByFuture(ppReqTransfer, ppRspInfo);
		}
		public delegate void DeleErrRtnFutureToBankByFuture(CThostFtdcReqTransferField pReqTransfer, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 期货发起期货资金转银行错误回报
		/// </summary>
		public DeleErrRtnFutureToBankByFuture OnErrRtnFutureToBankByFuture = null;
		private void onErrRtnFutureToBankByFuture(IntPtr  pReqTransfer, IntPtr  pRspInfo)
        {
			if (OnErrRtnFutureToBankByFuture == null)
            {
				return;
            }			
			var ppReqTransfer = new CThostFtdcReqTransferField();
			if (pReqTransfer != IntPtr.Zero)
			{
				ppReqTransfer = Marshal.PtrToStructure<CThostFtdcReqTransferField>(pReqTransfer);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnFutureToBankByFuture(ppReqTransfer, ppRspInfo);
		}
		public delegate void DeleErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField pReqRepeal, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 系统运行时期货端手工发起冲正银行转期货错误回报
		/// </summary>
		public DeleErrRtnRepealBankToFutureByFutureManual OnErrRtnRepealBankToFutureByFutureManual = null;
		private void onErrRtnRepealBankToFutureByFutureManual(IntPtr  pReqRepeal, IntPtr  pRspInfo)
        {
			if (OnErrRtnRepealBankToFutureByFutureManual == null)
            {
				return;
            }			
			var ppReqRepeal = new CThostFtdcReqRepealField();
			if (pReqRepeal != IntPtr.Zero)
			{
				ppReqRepeal = Marshal.PtrToStructure<CThostFtdcReqRepealField>(pReqRepeal);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnRepealBankToFutureByFutureManual(ppReqRepeal, ppRspInfo);
		}
		public delegate void DeleErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField pReqRepeal, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 系统运行时期货端手工发起冲正期货转银行错误回报
		/// </summary>
		public DeleErrRtnRepealFutureToBankByFutureManual OnErrRtnRepealFutureToBankByFutureManual = null;
		private void onErrRtnRepealFutureToBankByFutureManual(IntPtr  pReqRepeal, IntPtr  pRspInfo)
        {
			if (OnErrRtnRepealFutureToBankByFutureManual == null)
            {
				return;
            }			
			var ppReqRepeal = new CThostFtdcReqRepealField();
			if (pReqRepeal != IntPtr.Zero)
			{
				ppReqRepeal = Marshal.PtrToStructure<CThostFtdcReqRepealField>(pReqRepeal);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnRepealFutureToBankByFutureManual(ppReqRepeal, ppRspInfo);
		}
		public delegate void DeleErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField pReqQueryAccount, CThostFtdcRspInfoField pRspInfo);
		/// <summary>
		/// 期货发起查询银行余额错误回报
		/// </summary>
		public DeleErrRtnQueryBankBalanceByFuture OnErrRtnQueryBankBalanceByFuture = null;
		private void onErrRtnQueryBankBalanceByFuture(IntPtr  pReqQueryAccount, IntPtr  pRspInfo)
        {
			if (OnErrRtnQueryBankBalanceByFuture == null)
            {
				return;
            }			
			var ppReqQueryAccount = new CThostFtdcReqQueryAccountField();
			if (pReqQueryAccount != IntPtr.Zero)
			{
				ppReqQueryAccount = Marshal.PtrToStructure<CThostFtdcReqQueryAccountField>(pReqQueryAccount);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnErrRtnQueryBankBalanceByFuture(ppReqQueryAccount, ppRspInfo);
		}
		public delegate void DeleRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField pRspRepeal);
		/// <summary>
		/// 期货发起冲正银行转期货请求，银行处理完毕后报盘发回的通知
		/// </summary>
		public DeleRtnRepealFromBankToFutureByFuture OnRtnRepealFromBankToFutureByFuture = null;
		private void onRtnRepealFromBankToFutureByFuture(IntPtr  pRspRepeal)
        {
			if (OnRtnRepealFromBankToFutureByFuture == null)
            {
				return;
            }			
			var ppRspRepeal = new CThostFtdcRspRepealField();
			if (pRspRepeal != IntPtr.Zero)
			{
				ppRspRepeal = Marshal.PtrToStructure<CThostFtdcRspRepealField>(pRspRepeal);
			}
			
			OnRtnRepealFromBankToFutureByFuture(ppRspRepeal);
		}
		public delegate void DeleRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField pRspRepeal);
		/// <summary>
		/// 期货发起冲正期货转银行请求，银行处理完毕后报盘发回的通知
		/// </summary>
		public DeleRtnRepealFromFutureToBankByFuture OnRtnRepealFromFutureToBankByFuture = null;
		private void onRtnRepealFromFutureToBankByFuture(IntPtr  pRspRepeal)
        {
			if (OnRtnRepealFromFutureToBankByFuture == null)
            {
				return;
            }			
			var ppRspRepeal = new CThostFtdcRspRepealField();
			if (pRspRepeal != IntPtr.Zero)
			{
				ppRspRepeal = Marshal.PtrToStructure<CThostFtdcRspRepealField>(pRspRepeal);
			}
			
			OnRtnRepealFromFutureToBankByFuture(ppRspRepeal);
		}
		public delegate void DeleRspFromBankToFutureByFuture(CThostFtdcReqTransferField pReqTransfer, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 期货发起银行资金转期货应答
		/// </summary>
		public DeleRspFromBankToFutureByFuture OnRspFromBankToFutureByFuture = null;
		private void onRspFromBankToFutureByFuture(IntPtr  pReqTransfer, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspFromBankToFutureByFuture == null)
            {
				return;
            }			
			var ppReqTransfer = new CThostFtdcReqTransferField();
			if (pReqTransfer != IntPtr.Zero)
			{
				ppReqTransfer = Marshal.PtrToStructure<CThostFtdcReqTransferField>(pReqTransfer);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspFromBankToFutureByFuture(ppReqTransfer, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspFromFutureToBankByFuture(CThostFtdcReqTransferField pReqTransfer, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 期货发起期货资金转银行应答
		/// </summary>
		public DeleRspFromFutureToBankByFuture OnRspFromFutureToBankByFuture = null;
		private void onRspFromFutureToBankByFuture(IntPtr  pReqTransfer, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspFromFutureToBankByFuture == null)
            {
				return;
            }			
			var ppReqTransfer = new CThostFtdcReqTransferField();
			if (pReqTransfer != IntPtr.Zero)
			{
				ppReqTransfer = Marshal.PtrToStructure<CThostFtdcReqTransferField>(pReqTransfer);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspFromFutureToBankByFuture(ppReqTransfer, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField pReqQueryAccount, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 期货发起查询银行余额应答
		/// </summary>
		public DeleRspQueryBankAccountMoneyByFuture OnRspQueryBankAccountMoneyByFuture = null;
		private void onRspQueryBankAccountMoneyByFuture(IntPtr  pReqQueryAccount, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQueryBankAccountMoneyByFuture == null)
            {
				return;
            }			
			var ppReqQueryAccount = new CThostFtdcReqQueryAccountField();
			if (pReqQueryAccount != IntPtr.Zero)
			{
				ppReqQueryAccount = Marshal.PtrToStructure<CThostFtdcReqQueryAccountField>(pReqQueryAccount);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQueryBankAccountMoneyByFuture(ppReqQueryAccount, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRtnOpenAccountByBank(CThostFtdcOpenAccountField pOpenAccount);
		/// <summary>
		/// 银行发起银期开户通知
		/// </summary>
		public DeleRtnOpenAccountByBank OnRtnOpenAccountByBank = null;
		private void onRtnOpenAccountByBank(IntPtr  pOpenAccount)
        {
			if (OnRtnOpenAccountByBank == null)
            {
				return;
            }			
			var ppOpenAccount = new CThostFtdcOpenAccountField();
			if (pOpenAccount != IntPtr.Zero)
			{
				ppOpenAccount = Marshal.PtrToStructure<CThostFtdcOpenAccountField>(pOpenAccount);
			}
			
			OnRtnOpenAccountByBank(ppOpenAccount);
		}
		public delegate void DeleRtnCancelAccountByBank(CThostFtdcCancelAccountField pCancelAccount);
		/// <summary>
		/// 银行发起银期销户通知
		/// </summary>
		public DeleRtnCancelAccountByBank OnRtnCancelAccountByBank = null;
		private void onRtnCancelAccountByBank(IntPtr  pCancelAccount)
        {
			if (OnRtnCancelAccountByBank == null)
            {
				return;
            }			
			var ppCancelAccount = new CThostFtdcCancelAccountField();
			if (pCancelAccount != IntPtr.Zero)
			{
				ppCancelAccount = Marshal.PtrToStructure<CThostFtdcCancelAccountField>(pCancelAccount);
			}
			
			OnRtnCancelAccountByBank(ppCancelAccount);
		}
		public delegate void DeleRtnChangeAccountByBank(CThostFtdcChangeAccountField pChangeAccount);
		/// <summary>
		/// 银行发起变更银行账号通知
		/// </summary>
		public DeleRtnChangeAccountByBank OnRtnChangeAccountByBank = null;
		private void onRtnChangeAccountByBank(IntPtr  pChangeAccount)
        {
			if (OnRtnChangeAccountByBank == null)
            {
				return;
            }			
			var ppChangeAccount = new CThostFtdcChangeAccountField();
			if (pChangeAccount != IntPtr.Zero)
			{
				ppChangeAccount = Marshal.PtrToStructure<CThostFtdcChangeAccountField>(pChangeAccount);
			}
			
			OnRtnChangeAccountByBank(ppChangeAccount);
		}
		public delegate void DeleRspQryClassifiedInstrument(CThostFtdcInstrumentField pInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求查询分类合约响应
		/// </summary>
		public DeleRspQryClassifiedInstrument OnRspQryClassifiedInstrument = null;
		private void onRspQryClassifiedInstrument(IntPtr  pInstrument, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryClassifiedInstrument == null)
            {
				return;
            }			
			var ppInstrument = new CThostFtdcInstrumentField();
			if (pInstrument != IntPtr.Zero)
			{
				ppInstrument = Marshal.PtrToStructure<CThostFtdcInstrumentField>(pInstrument);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryClassifiedInstrument(ppInstrument, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryCombPromotionParam(CThostFtdcCombPromotionParamField pCombPromotionParam, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 请求组合优惠比例响应
		/// </summary>
		public DeleRspQryCombPromotionParam OnRspQryCombPromotionParam = null;
		private void onRspQryCombPromotionParam(IntPtr  pCombPromotionParam, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryCombPromotionParam == null)
            {
				return;
            }			
			var ppCombPromotionParam = new CThostFtdcCombPromotionParamField();
			if (pCombPromotionParam != IntPtr.Zero)
			{
				ppCombPromotionParam = Marshal.PtrToStructure<CThostFtdcCombPromotionParamField>(pCombPromotionParam);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryCombPromotionParam(ppCombPromotionParam, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryRiskSettleInvstPosition(CThostFtdcRiskSettleInvstPositionField pRiskSettleInvstPosition, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 投资者风险结算持仓查询响应
		/// </summary>
		public DeleRspQryRiskSettleInvstPosition OnRspQryRiskSettleInvstPosition = null;
		private void onRspQryRiskSettleInvstPosition(IntPtr  pRiskSettleInvstPosition, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryRiskSettleInvstPosition == null)
            {
				return;
            }			
			var ppRiskSettleInvstPosition = new CThostFtdcRiskSettleInvstPositionField();
			if (pRiskSettleInvstPosition != IntPtr.Zero)
			{
				ppRiskSettleInvstPosition = Marshal.PtrToStructure<CThostFtdcRiskSettleInvstPositionField>(pRiskSettleInvstPosition);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryRiskSettleInvstPosition(ppRiskSettleInvstPosition, ppRspInfo, nRequestID, bIsLast);
		}
		public delegate void DeleRspQryRiskSettleProductStatus(CThostFtdcRiskSettleProductStatusField pRiskSettleProductStatus, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast);
		/// <summary>
		/// 风险结算产品查询响应
		/// </summary>
		public DeleRspQryRiskSettleProductStatus OnRspQryRiskSettleProductStatus = null;
		private void onRspQryRiskSettleProductStatus(IntPtr  pRiskSettleProductStatus, IntPtr  pRspInfo, int nRequestID, bool bIsLast)
        {
			if (OnRspQryRiskSettleProductStatus == null)
            {
				return;
            }			
			var ppRiskSettleProductStatus = new CThostFtdcRiskSettleProductStatusField();
			if (pRiskSettleProductStatus != IntPtr.Zero)
			{
				ppRiskSettleProductStatus = Marshal.PtrToStructure<CThostFtdcRiskSettleProductStatusField>(pRiskSettleProductStatus);
			}
						
			var ppRspInfo = new CThostFtdcRspInfoField();
			if (pRspInfo != IntPtr.Zero)
			{
				ppRspInfo = Marshal.PtrToStructure<CThostFtdcRspInfoField>(pRspInfo);
			}
			
			OnRspQryRiskSettleProductStatus(ppRiskSettleProductStatus, ppRspInfo, nRequestID, bIsLast);
		}
		
		#endregion

		IntPtr _handle = IntPtr.Zero, _api = IntPtr.Zero, _spi = IntPtr.Zero;
		
		public ctp_trade()
		{
			Directory.CreateDirectory("log");
			_api = tCreateApi();
			_spi = tCreateSpi();
			tRegisterSpi(_api, _spi);

			#region 注册事件,用adddele避免被回收
			tSetOnFrontConnected(_spi, (deleFrontConnected)AddDele(new deleFrontConnected((onFrontConnected))));
			tSetOnFrontDisconnected(_spi, (deleFrontDisconnected)AddDele(new deleFrontDisconnected((onFrontDisconnected))));
			tSetOnHeartBeatWarning(_spi, (deleHeartBeatWarning)AddDele(new deleHeartBeatWarning((onHeartBeatWarning))));
			tSetOnRspAuthenticate(_spi, (deleRspAuthenticate)AddDele(new deleRspAuthenticate((onRspAuthenticate))));
			tSetOnRspUserLogin(_spi, (deleRspUserLogin)AddDele(new deleRspUserLogin((onRspUserLogin))));
			tSetOnRspUserLogout(_spi, (deleRspUserLogout)AddDele(new deleRspUserLogout((onRspUserLogout))));
			tSetOnRspUserPasswordUpdate(_spi, (deleRspUserPasswordUpdate)AddDele(new deleRspUserPasswordUpdate((onRspUserPasswordUpdate))));
			tSetOnRspTradingAccountPasswordUpdate(_spi, (deleRspTradingAccountPasswordUpdate)AddDele(new deleRspTradingAccountPasswordUpdate((onRspTradingAccountPasswordUpdate))));
			tSetOnRspUserAuthMethod(_spi, (deleRspUserAuthMethod)AddDele(new deleRspUserAuthMethod((onRspUserAuthMethod))));
			tSetOnRspGenUserCaptcha(_spi, (deleRspGenUserCaptcha)AddDele(new deleRspGenUserCaptcha((onRspGenUserCaptcha))));
			tSetOnRspGenUserText(_spi, (deleRspGenUserText)AddDele(new deleRspGenUserText((onRspGenUserText))));
			tSetOnRspOrderInsert(_spi, (deleRspOrderInsert)AddDele(new deleRspOrderInsert((onRspOrderInsert))));
			tSetOnRspParkedOrderInsert(_spi, (deleRspParkedOrderInsert)AddDele(new deleRspParkedOrderInsert((onRspParkedOrderInsert))));
			tSetOnRspParkedOrderAction(_spi, (deleRspParkedOrderAction)AddDele(new deleRspParkedOrderAction((onRspParkedOrderAction))));
			tSetOnRspOrderAction(_spi, (deleRspOrderAction)AddDele(new deleRspOrderAction((onRspOrderAction))));
			tSetOnRspQryMaxOrderVolume(_spi, (deleRspQryMaxOrderVolume)AddDele(new deleRspQryMaxOrderVolume((onRspQryMaxOrderVolume))));
			tSetOnRspSettlementInfoConfirm(_spi, (deleRspSettlementInfoConfirm)AddDele(new deleRspSettlementInfoConfirm((onRspSettlementInfoConfirm))));
			tSetOnRspRemoveParkedOrder(_spi, (deleRspRemoveParkedOrder)AddDele(new deleRspRemoveParkedOrder((onRspRemoveParkedOrder))));
			tSetOnRspRemoveParkedOrderAction(_spi, (deleRspRemoveParkedOrderAction)AddDele(new deleRspRemoveParkedOrderAction((onRspRemoveParkedOrderAction))));
			tSetOnRspExecOrderInsert(_spi, (deleRspExecOrderInsert)AddDele(new deleRspExecOrderInsert((onRspExecOrderInsert))));
			tSetOnRspExecOrderAction(_spi, (deleRspExecOrderAction)AddDele(new deleRspExecOrderAction((onRspExecOrderAction))));
			tSetOnRspForQuoteInsert(_spi, (deleRspForQuoteInsert)AddDele(new deleRspForQuoteInsert((onRspForQuoteInsert))));
			tSetOnRspQuoteInsert(_spi, (deleRspQuoteInsert)AddDele(new deleRspQuoteInsert((onRspQuoteInsert))));
			tSetOnRspQuoteAction(_spi, (deleRspQuoteAction)AddDele(new deleRspQuoteAction((onRspQuoteAction))));
			tSetOnRspBatchOrderAction(_spi, (deleRspBatchOrderAction)AddDele(new deleRspBatchOrderAction((onRspBatchOrderAction))));
			tSetOnRspOptionSelfCloseInsert(_spi, (deleRspOptionSelfCloseInsert)AddDele(new deleRspOptionSelfCloseInsert((onRspOptionSelfCloseInsert))));
			tSetOnRspOptionSelfCloseAction(_spi, (deleRspOptionSelfCloseAction)AddDele(new deleRspOptionSelfCloseAction((onRspOptionSelfCloseAction))));
			tSetOnRspCombActionInsert(_spi, (deleRspCombActionInsert)AddDele(new deleRspCombActionInsert((onRspCombActionInsert))));
			tSetOnRspQryOrder(_spi, (deleRspQryOrder)AddDele(new deleRspQryOrder((onRspQryOrder))));
			tSetOnRspQryTrade(_spi, (deleRspQryTrade)AddDele(new deleRspQryTrade((onRspQryTrade))));
			tSetOnRspQryInvestorPosition(_spi, (deleRspQryInvestorPosition)AddDele(new deleRspQryInvestorPosition((onRspQryInvestorPosition))));
			tSetOnRspQryTradingAccount(_spi, (deleRspQryTradingAccount)AddDele(new deleRspQryTradingAccount((onRspQryTradingAccount))));
			tSetOnRspQryInvestor(_spi, (deleRspQryInvestor)AddDele(new deleRspQryInvestor((onRspQryInvestor))));
			tSetOnRspQryTradingCode(_spi, (deleRspQryTradingCode)AddDele(new deleRspQryTradingCode((onRspQryTradingCode))));
			tSetOnRspQryInstrumentMarginRate(_spi, (deleRspQryInstrumentMarginRate)AddDele(new deleRspQryInstrumentMarginRate((onRspQryInstrumentMarginRate))));
			tSetOnRspQryInstrumentCommissionRate(_spi, (deleRspQryInstrumentCommissionRate)AddDele(new deleRspQryInstrumentCommissionRate((onRspQryInstrumentCommissionRate))));
			tSetOnRspQryExchange(_spi, (deleRspQryExchange)AddDele(new deleRspQryExchange((onRspQryExchange))));
			tSetOnRspQryProduct(_spi, (deleRspQryProduct)AddDele(new deleRspQryProduct((onRspQryProduct))));
			tSetOnRspQryInstrument(_spi, (deleRspQryInstrument)AddDele(new deleRspQryInstrument((onRspQryInstrument))));
			tSetOnRspQryDepthMarketData(_spi, (deleRspQryDepthMarketData)AddDele(new deleRspQryDepthMarketData((onRspQryDepthMarketData))));
			tSetOnRspQryTraderOffer(_spi, (deleRspQryTraderOffer)AddDele(new deleRspQryTraderOffer((onRspQryTraderOffer))));
			tSetOnRspQrySettlementInfo(_spi, (deleRspQrySettlementInfo)AddDele(new deleRspQrySettlementInfo((onRspQrySettlementInfo))));
			tSetOnRspQryTransferBank(_spi, (deleRspQryTransferBank)AddDele(new deleRspQryTransferBank((onRspQryTransferBank))));
			tSetOnRspQryInvestorPositionDetail(_spi, (deleRspQryInvestorPositionDetail)AddDele(new deleRspQryInvestorPositionDetail((onRspQryInvestorPositionDetail))));
			tSetOnRspQryNotice(_spi, (deleRspQryNotice)AddDele(new deleRspQryNotice((onRspQryNotice))));
			tSetOnRspQrySettlementInfoConfirm(_spi, (deleRspQrySettlementInfoConfirm)AddDele(new deleRspQrySettlementInfoConfirm((onRspQrySettlementInfoConfirm))));
			tSetOnRspQryInvestorPositionCombineDetail(_spi, (deleRspQryInvestorPositionCombineDetail)AddDele(new deleRspQryInvestorPositionCombineDetail((onRspQryInvestorPositionCombineDetail))));
			tSetOnRspQryCFMMCTradingAccountKey(_spi, (deleRspQryCFMMCTradingAccountKey)AddDele(new deleRspQryCFMMCTradingAccountKey((onRspQryCFMMCTradingAccountKey))));
			tSetOnRspQryEWarrantOffset(_spi, (deleRspQryEWarrantOffset)AddDele(new deleRspQryEWarrantOffset((onRspQryEWarrantOffset))));
			tSetOnRspQryInvestorProductGroupMargin(_spi, (deleRspQryInvestorProductGroupMargin)AddDele(new deleRspQryInvestorProductGroupMargin((onRspQryInvestorProductGroupMargin))));
			tSetOnRspQryExchangeMarginRate(_spi, (deleRspQryExchangeMarginRate)AddDele(new deleRspQryExchangeMarginRate((onRspQryExchangeMarginRate))));
			tSetOnRspQryExchangeMarginRateAdjust(_spi, (deleRspQryExchangeMarginRateAdjust)AddDele(new deleRspQryExchangeMarginRateAdjust((onRspQryExchangeMarginRateAdjust))));
			tSetOnRspQryExchangeRate(_spi, (deleRspQryExchangeRate)AddDele(new deleRspQryExchangeRate((onRspQryExchangeRate))));
			tSetOnRspQrySecAgentACIDMap(_spi, (deleRspQrySecAgentACIDMap)AddDele(new deleRspQrySecAgentACIDMap((onRspQrySecAgentACIDMap))));
			tSetOnRspQryProductExchRate(_spi, (deleRspQryProductExchRate)AddDele(new deleRspQryProductExchRate((onRspQryProductExchRate))));
			tSetOnRspQryProductGroup(_spi, (deleRspQryProductGroup)AddDele(new deleRspQryProductGroup((onRspQryProductGroup))));
			tSetOnRspQryMMInstrumentCommissionRate(_spi, (deleRspQryMMInstrumentCommissionRate)AddDele(new deleRspQryMMInstrumentCommissionRate((onRspQryMMInstrumentCommissionRate))));
			tSetOnRspQryMMOptionInstrCommRate(_spi, (deleRspQryMMOptionInstrCommRate)AddDele(new deleRspQryMMOptionInstrCommRate((onRspQryMMOptionInstrCommRate))));
			tSetOnRspQryInstrumentOrderCommRate(_spi, (deleRspQryInstrumentOrderCommRate)AddDele(new deleRspQryInstrumentOrderCommRate((onRspQryInstrumentOrderCommRate))));
			tSetOnRspQrySecAgentTradingAccount(_spi, (deleRspQrySecAgentTradingAccount)AddDele(new deleRspQrySecAgentTradingAccount((onRspQrySecAgentTradingAccount))));
			tSetOnRspQrySecAgentCheckMode(_spi, (deleRspQrySecAgentCheckMode)AddDele(new deleRspQrySecAgentCheckMode((onRspQrySecAgentCheckMode))));
			tSetOnRspQrySecAgentTradeInfo(_spi, (deleRspQrySecAgentTradeInfo)AddDele(new deleRspQrySecAgentTradeInfo((onRspQrySecAgentTradeInfo))));
			tSetOnRspQryOptionInstrTradeCost(_spi, (deleRspQryOptionInstrTradeCost)AddDele(new deleRspQryOptionInstrTradeCost((onRspQryOptionInstrTradeCost))));
			tSetOnRspQryOptionInstrCommRate(_spi, (deleRspQryOptionInstrCommRate)AddDele(new deleRspQryOptionInstrCommRate((onRspQryOptionInstrCommRate))));
			tSetOnRspQryExecOrder(_spi, (deleRspQryExecOrder)AddDele(new deleRspQryExecOrder((onRspQryExecOrder))));
			tSetOnRspQryForQuote(_spi, (deleRspQryForQuote)AddDele(new deleRspQryForQuote((onRspQryForQuote))));
			tSetOnRspQryQuote(_spi, (deleRspQryQuote)AddDele(new deleRspQryQuote((onRspQryQuote))));
			tSetOnRspQryOptionSelfClose(_spi, (deleRspQryOptionSelfClose)AddDele(new deleRspQryOptionSelfClose((onRspQryOptionSelfClose))));
			tSetOnRspQryInvestUnit(_spi, (deleRspQryInvestUnit)AddDele(new deleRspQryInvestUnit((onRspQryInvestUnit))));
			tSetOnRspQryCombInstrumentGuard(_spi, (deleRspQryCombInstrumentGuard)AddDele(new deleRspQryCombInstrumentGuard((onRspQryCombInstrumentGuard))));
			tSetOnRspQryCombAction(_spi, (deleRspQryCombAction)AddDele(new deleRspQryCombAction((onRspQryCombAction))));
			tSetOnRspQryTransferSerial(_spi, (deleRspQryTransferSerial)AddDele(new deleRspQryTransferSerial((onRspQryTransferSerial))));
			tSetOnRspQryAccountregister(_spi, (deleRspQryAccountregister)AddDele(new deleRspQryAccountregister((onRspQryAccountregister))));
			tSetOnRspError(_spi, (deleRspError)AddDele(new deleRspError((onRspError))));
			tSetOnRtnOrder(_spi, (deleRtnOrder)AddDele(new deleRtnOrder((onRtnOrder))));
			tSetOnRtnTrade(_spi, (deleRtnTrade)AddDele(new deleRtnTrade((onRtnTrade))));
			tSetOnErrRtnOrderInsert(_spi, (deleErrRtnOrderInsert)AddDele(new deleErrRtnOrderInsert((onErrRtnOrderInsert))));
			tSetOnErrRtnOrderAction(_spi, (deleErrRtnOrderAction)AddDele(new deleErrRtnOrderAction((onErrRtnOrderAction))));
			tSetOnRtnInstrumentStatus(_spi, (deleRtnInstrumentStatus)AddDele(new deleRtnInstrumentStatus((onRtnInstrumentStatus))));
			tSetOnRtnBulletin(_spi, (deleRtnBulletin)AddDele(new deleRtnBulletin((onRtnBulletin))));
			tSetOnRtnTradingNotice(_spi, (deleRtnTradingNotice)AddDele(new deleRtnTradingNotice((onRtnTradingNotice))));
			tSetOnRtnErrorConditionalOrder(_spi, (deleRtnErrorConditionalOrder)AddDele(new deleRtnErrorConditionalOrder((onRtnErrorConditionalOrder))));
			tSetOnRtnExecOrder(_spi, (deleRtnExecOrder)AddDele(new deleRtnExecOrder((onRtnExecOrder))));
			tSetOnErrRtnExecOrderInsert(_spi, (deleErrRtnExecOrderInsert)AddDele(new deleErrRtnExecOrderInsert((onErrRtnExecOrderInsert))));
			tSetOnErrRtnExecOrderAction(_spi, (deleErrRtnExecOrderAction)AddDele(new deleErrRtnExecOrderAction((onErrRtnExecOrderAction))));
			tSetOnErrRtnForQuoteInsert(_spi, (deleErrRtnForQuoteInsert)AddDele(new deleErrRtnForQuoteInsert((onErrRtnForQuoteInsert))));
			tSetOnRtnQuote(_spi, (deleRtnQuote)AddDele(new deleRtnQuote((onRtnQuote))));
			tSetOnErrRtnQuoteInsert(_spi, (deleErrRtnQuoteInsert)AddDele(new deleErrRtnQuoteInsert((onErrRtnQuoteInsert))));
			tSetOnErrRtnQuoteAction(_spi, (deleErrRtnQuoteAction)AddDele(new deleErrRtnQuoteAction((onErrRtnQuoteAction))));
			tSetOnRtnForQuoteRsp(_spi, (deleRtnForQuoteRsp)AddDele(new deleRtnForQuoteRsp((onRtnForQuoteRsp))));
			tSetOnRtnCFMMCTradingAccountToken(_spi, (deleRtnCFMMCTradingAccountToken)AddDele(new deleRtnCFMMCTradingAccountToken((onRtnCFMMCTradingAccountToken))));
			tSetOnErrRtnBatchOrderAction(_spi, (deleErrRtnBatchOrderAction)AddDele(new deleErrRtnBatchOrderAction((onErrRtnBatchOrderAction))));
			tSetOnRtnOptionSelfClose(_spi, (deleRtnOptionSelfClose)AddDele(new deleRtnOptionSelfClose((onRtnOptionSelfClose))));
			tSetOnErrRtnOptionSelfCloseInsert(_spi, (deleErrRtnOptionSelfCloseInsert)AddDele(new deleErrRtnOptionSelfCloseInsert((onErrRtnOptionSelfCloseInsert))));
			tSetOnErrRtnOptionSelfCloseAction(_spi, (deleErrRtnOptionSelfCloseAction)AddDele(new deleErrRtnOptionSelfCloseAction((onErrRtnOptionSelfCloseAction))));
			tSetOnRtnCombAction(_spi, (deleRtnCombAction)AddDele(new deleRtnCombAction((onRtnCombAction))));
			tSetOnErrRtnCombActionInsert(_spi, (deleErrRtnCombActionInsert)AddDele(new deleErrRtnCombActionInsert((onErrRtnCombActionInsert))));
			tSetOnRspQryContractBank(_spi, (deleRspQryContractBank)AddDele(new deleRspQryContractBank((onRspQryContractBank))));
			tSetOnRspQryParkedOrder(_spi, (deleRspQryParkedOrder)AddDele(new deleRspQryParkedOrder((onRspQryParkedOrder))));
			tSetOnRspQryParkedOrderAction(_spi, (deleRspQryParkedOrderAction)AddDele(new deleRspQryParkedOrderAction((onRspQryParkedOrderAction))));
			tSetOnRspQryTradingNotice(_spi, (deleRspQryTradingNotice)AddDele(new deleRspQryTradingNotice((onRspQryTradingNotice))));
			tSetOnRspQryBrokerTradingParams(_spi, (deleRspQryBrokerTradingParams)AddDele(new deleRspQryBrokerTradingParams((onRspQryBrokerTradingParams))));
			tSetOnRspQryBrokerTradingAlgos(_spi, (deleRspQryBrokerTradingAlgos)AddDele(new deleRspQryBrokerTradingAlgos((onRspQryBrokerTradingAlgos))));
			tSetOnRspQueryCFMMCTradingAccountToken(_spi, (deleRspQueryCFMMCTradingAccountToken)AddDele(new deleRspQueryCFMMCTradingAccountToken((onRspQueryCFMMCTradingAccountToken))));
			tSetOnRtnFromBankToFutureByBank(_spi, (deleRtnFromBankToFutureByBank)AddDele(new deleRtnFromBankToFutureByBank((onRtnFromBankToFutureByBank))));
			tSetOnRtnFromFutureToBankByBank(_spi, (deleRtnFromFutureToBankByBank)AddDele(new deleRtnFromFutureToBankByBank((onRtnFromFutureToBankByBank))));
			tSetOnRtnRepealFromBankToFutureByBank(_spi, (deleRtnRepealFromBankToFutureByBank)AddDele(new deleRtnRepealFromBankToFutureByBank((onRtnRepealFromBankToFutureByBank))));
			tSetOnRtnRepealFromFutureToBankByBank(_spi, (deleRtnRepealFromFutureToBankByBank)AddDele(new deleRtnRepealFromFutureToBankByBank((onRtnRepealFromFutureToBankByBank))));
			tSetOnRtnFromBankToFutureByFuture(_spi, (deleRtnFromBankToFutureByFuture)AddDele(new deleRtnFromBankToFutureByFuture((onRtnFromBankToFutureByFuture))));
			tSetOnRtnFromFutureToBankByFuture(_spi, (deleRtnFromFutureToBankByFuture)AddDele(new deleRtnFromFutureToBankByFuture((onRtnFromFutureToBankByFuture))));
			tSetOnRtnRepealFromBankToFutureByFutureManual(_spi, (deleRtnRepealFromBankToFutureByFutureManual)AddDele(new deleRtnRepealFromBankToFutureByFutureManual((onRtnRepealFromBankToFutureByFutureManual))));
			tSetOnRtnRepealFromFutureToBankByFutureManual(_spi, (deleRtnRepealFromFutureToBankByFutureManual)AddDele(new deleRtnRepealFromFutureToBankByFutureManual((onRtnRepealFromFutureToBankByFutureManual))));
			tSetOnRtnQueryBankBalanceByFuture(_spi, (deleRtnQueryBankBalanceByFuture)AddDele(new deleRtnQueryBankBalanceByFuture((onRtnQueryBankBalanceByFuture))));
			tSetOnErrRtnBankToFutureByFuture(_spi, (deleErrRtnBankToFutureByFuture)AddDele(new deleErrRtnBankToFutureByFuture((onErrRtnBankToFutureByFuture))));
			tSetOnErrRtnFutureToBankByFuture(_spi, (deleErrRtnFutureToBankByFuture)AddDele(new deleErrRtnFutureToBankByFuture((onErrRtnFutureToBankByFuture))));
			tSetOnErrRtnRepealBankToFutureByFutureManual(_spi, (deleErrRtnRepealBankToFutureByFutureManual)AddDele(new deleErrRtnRepealBankToFutureByFutureManual((onErrRtnRepealBankToFutureByFutureManual))));
			tSetOnErrRtnRepealFutureToBankByFutureManual(_spi, (deleErrRtnRepealFutureToBankByFutureManual)AddDele(new deleErrRtnRepealFutureToBankByFutureManual((onErrRtnRepealFutureToBankByFutureManual))));
			tSetOnErrRtnQueryBankBalanceByFuture(_spi, (deleErrRtnQueryBankBalanceByFuture)AddDele(new deleErrRtnQueryBankBalanceByFuture((onErrRtnQueryBankBalanceByFuture))));
			tSetOnRtnRepealFromBankToFutureByFuture(_spi, (deleRtnRepealFromBankToFutureByFuture)AddDele(new deleRtnRepealFromBankToFutureByFuture((onRtnRepealFromBankToFutureByFuture))));
			tSetOnRtnRepealFromFutureToBankByFuture(_spi, (deleRtnRepealFromFutureToBankByFuture)AddDele(new deleRtnRepealFromFutureToBankByFuture((onRtnRepealFromFutureToBankByFuture))));
			tSetOnRspFromBankToFutureByFuture(_spi, (deleRspFromBankToFutureByFuture)AddDele(new deleRspFromBankToFutureByFuture((onRspFromBankToFutureByFuture))));
			tSetOnRspFromFutureToBankByFuture(_spi, (deleRspFromFutureToBankByFuture)AddDele(new deleRspFromFutureToBankByFuture((onRspFromFutureToBankByFuture))));
			tSetOnRspQueryBankAccountMoneyByFuture(_spi, (deleRspQueryBankAccountMoneyByFuture)AddDele(new deleRspQueryBankAccountMoneyByFuture((onRspQueryBankAccountMoneyByFuture))));
			tSetOnRtnOpenAccountByBank(_spi, (deleRtnOpenAccountByBank)AddDele(new deleRtnOpenAccountByBank((onRtnOpenAccountByBank))));
			tSetOnRtnCancelAccountByBank(_spi, (deleRtnCancelAccountByBank)AddDele(new deleRtnCancelAccountByBank((onRtnCancelAccountByBank))));
			tSetOnRtnChangeAccountByBank(_spi, (deleRtnChangeAccountByBank)AddDele(new deleRtnChangeAccountByBank((onRtnChangeAccountByBank))));
			tSetOnRspQryClassifiedInstrument(_spi, (deleRspQryClassifiedInstrument)AddDele(new deleRspQryClassifiedInstrument((onRspQryClassifiedInstrument))));
			tSetOnRspQryCombPromotionParam(_spi, (deleRspQryCombPromotionParam)AddDele(new deleRspQryCombPromotionParam((onRspQryCombPromotionParam))));
			tSetOnRspQryRiskSettleInvstPosition(_spi, (deleRspQryRiskSettleInvstPosition)AddDele(new deleRspQryRiskSettleInvstPosition((onRspQryRiskSettleInvstPosition))));
			tSetOnRspQryRiskSettleProductStatus(_spi, (deleRspQryRiskSettleProductStatus)AddDele(new deleRspQryRiskSettleProductStatus((onRspQryRiskSettleProductStatus))));
			
			#endregion
		}
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tCreateApi();
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tCreateSpi();
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tGetVersion();
		public string GetVersion() => Marshal.PtrToStringAnsi(tGetVersion())??"";
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tRelease(IntPtr api);
		/// <summary>
		/// 创建TraderApi
		/// </summary>
		public void Release()
		{
			tRelease(_api);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tInit(IntPtr api);
		/// <summary>
		/// 初始化
		/// </summary>
		public void Init()
		{
			tInit(_api);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tJoin(IntPtr api);
		/// <summary>
		/// 等待接口线程结束运行
		/// </summary>
		public void Join()
		{
			tJoin(_api);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tRegisterFront(IntPtr api, string pszFrontAddress);
		/// <summary>
		/// 注册前置机网络地址
		/// </summary>
		public void RegisterFront(string pszFrontAddress)
		{
			tRegisterFront(_api, pszFrontAddress);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tRegisterNameServer(IntPtr api, string pszNsAddress);
		/// <summary>
		/// @remark RegisterNameServer优先于RegisterFront
		/// </summary>
		public void RegisterNameServer(string pszNsAddress)
		{
			tRegisterNameServer(_api, pszNsAddress);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tRegisterFensUserInfo(IntPtr api, ref CThostFtdcFensUserInfoField  pFensUserInfo);
		/// <summary>
		/// 注册名字服务器用户信息
		/// </summary>
		public void RegisterFensUserInfo(CThostFtdcFensUserInfoField  pFensUserInfo)
		{
			tRegisterFensUserInfo(_api, ref  pFensUserInfo);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tRegisterSpi(IntPtr api, IntPtr pSpi);
		/// <summary>
		/// 注册回调接口
		/// </summary>
		public void RegisterSpi(IntPtr pSpi)
		{
			tRegisterSpi(_api, pSpi);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSubscribePrivateTopic(IntPtr api, int nResumeType);
		/// <summary>
		/// 订阅私有流。
		/// </summary>
		public void SubscribePrivateTopic(int nResumeType)
		{
			tSubscribePrivateTopic(_api, nResumeType);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSubscribePublicTopic(IntPtr api, int nResumeType);
		/// <summary>
		/// 订阅公共流。
		/// </summary>
		public void SubscribePublicTopic(int nResumeType)
		{
			tSubscribePublicTopic(_api, nResumeType);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqAuthenticate(IntPtr api, ref CThostFtdcReqAuthenticateField pReqAuthenticateField, int nRequestID);
		/// <summary>
		/// 客户端认证请求
		/// </summary>
		public void ReqAuthenticate(CThostFtdcReqAuthenticateField pReqAuthenticateField, int nRequestID)
		{
			tReqAuthenticate(_api, ref pReqAuthenticateField, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tRegisterUserSystemInfo(IntPtr api, ref CThostFtdcUserSystemInfoField pUserSystemInfo);
		/// <summary>
		/// 注册用户终端信息，用于中继服务器多连接模式
		/// </summary>
		public void RegisterUserSystemInfo(CThostFtdcUserSystemInfoField pUserSystemInfo)
		{
			tRegisterUserSystemInfo(_api, ref pUserSystemInfo);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSubmitUserSystemInfo(IntPtr api, ref CThostFtdcUserSystemInfoField pUserSystemInfo);
		/// <summary>
		/// 上报用户终端信息，用于中继服务器操作员登录模式
		/// </summary>
		public void SubmitUserSystemInfo(CThostFtdcUserSystemInfoField pUserSystemInfo)
		{
			tSubmitUserSystemInfo(_api, ref pUserSystemInfo);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqUserLogin(IntPtr api, ref CThostFtdcReqUserLoginField pReqUserLoginField, int nRequestID);
		/// <summary>
		/// 用户登录请求
		/// </summary>
		public void ReqUserLogin(CThostFtdcReqUserLoginField pReqUserLoginField, int nRequestID)
		{
			tReqUserLogin(_api, ref pReqUserLoginField, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqUserLogout(IntPtr api, ref CThostFtdcUserLogoutField pUserLogout, int nRequestID);
		/// <summary>
		/// 登出请求
		/// </summary>
		public void ReqUserLogout(CThostFtdcUserLogoutField pUserLogout, int nRequestID)
		{
			tReqUserLogout(_api, ref pUserLogout, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqUserPasswordUpdate(IntPtr api, ref CThostFtdcUserPasswordUpdateField pUserPasswordUpdate, int nRequestID);
		/// <summary>
		/// 用户口令更新请求
		/// </summary>
		public void ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField pUserPasswordUpdate, int nRequestID)
		{
			tReqUserPasswordUpdate(_api, ref pUserPasswordUpdate, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqTradingAccountPasswordUpdate(IntPtr api, ref CThostFtdcTradingAccountPasswordUpdateField pTradingAccountPasswordUpdate, int nRequestID);
		/// <summary>
		/// 资金账户口令更新请求
		/// </summary>
		public void ReqTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField pTradingAccountPasswordUpdate, int nRequestID)
		{
			tReqTradingAccountPasswordUpdate(_api, ref pTradingAccountPasswordUpdate, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqUserAuthMethod(IntPtr api, ref CThostFtdcReqUserAuthMethodField pReqUserAuthMethod, int nRequestID);
		/// <summary>
		/// 查询用户当前支持的认证模式
		/// </summary>
		public void ReqUserAuthMethod(CThostFtdcReqUserAuthMethodField pReqUserAuthMethod, int nRequestID)
		{
			tReqUserAuthMethod(_api, ref pReqUserAuthMethod, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqGenUserCaptcha(IntPtr api, ref CThostFtdcReqGenUserCaptchaField pReqGenUserCaptcha, int nRequestID);
		/// <summary>
		/// 用户发出获取图形验证码请求
		/// </summary>
		public void ReqGenUserCaptcha(CThostFtdcReqGenUserCaptchaField pReqGenUserCaptcha, int nRequestID)
		{
			tReqGenUserCaptcha(_api, ref pReqGenUserCaptcha, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqGenUserText(IntPtr api, ref CThostFtdcReqGenUserTextField pReqGenUserText, int nRequestID);
		/// <summary>
		/// 用户发出获取短信验证码请求
		/// </summary>
		public void ReqGenUserText(CThostFtdcReqGenUserTextField pReqGenUserText, int nRequestID)
		{
			tReqGenUserText(_api, ref pReqGenUserText, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqUserLoginWithCaptcha(IntPtr api, ref CThostFtdcReqUserLoginWithCaptchaField pReqUserLoginWithCaptcha, int nRequestID);
		/// <summary>
		/// 用户发出带有图片验证码的登陆请求
		/// </summary>
		public void ReqUserLoginWithCaptcha(CThostFtdcReqUserLoginWithCaptchaField pReqUserLoginWithCaptcha, int nRequestID)
		{
			tReqUserLoginWithCaptcha(_api, ref pReqUserLoginWithCaptcha, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqUserLoginWithText(IntPtr api, ref CThostFtdcReqUserLoginWithTextField pReqUserLoginWithText, int nRequestID);
		/// <summary>
		/// 用户发出带有短信验证码的登陆请求
		/// </summary>
		public void ReqUserLoginWithText(CThostFtdcReqUserLoginWithTextField pReqUserLoginWithText, int nRequestID)
		{
			tReqUserLoginWithText(_api, ref pReqUserLoginWithText, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqUserLoginWithOTP(IntPtr api, ref CThostFtdcReqUserLoginWithOTPField pReqUserLoginWithOTP, int nRequestID);
		/// <summary>
		/// 用户发出带有动态口令的登陆请求
		/// </summary>
		public void ReqUserLoginWithOTP(CThostFtdcReqUserLoginWithOTPField pReqUserLoginWithOTP, int nRequestID)
		{
			tReqUserLoginWithOTP(_api, ref pReqUserLoginWithOTP, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqOrderInsert(IntPtr api, ref CThostFtdcInputOrderField pInputOrder, int nRequestID);
		/// <summary>
		/// 报单录入请求
		/// </summary>
		public void ReqOrderInsert(CThostFtdcInputOrderField pInputOrder, int nRequestID)
		{
			tReqOrderInsert(_api, ref pInputOrder, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqParkedOrderInsert(IntPtr api, ref CThostFtdcParkedOrderField pParkedOrder, int nRequestID);
		/// <summary>
		/// 预埋单录入请求
		/// </summary>
		public void ReqParkedOrderInsert(CThostFtdcParkedOrderField pParkedOrder, int nRequestID)
		{
			tReqParkedOrderInsert(_api, ref pParkedOrder, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqParkedOrderAction(IntPtr api, ref CThostFtdcParkedOrderActionField pParkedOrderAction, int nRequestID);
		/// <summary>
		/// 预埋撤单录入请求
		/// </summary>
		public void ReqParkedOrderAction(CThostFtdcParkedOrderActionField pParkedOrderAction, int nRequestID)
		{
			tReqParkedOrderAction(_api, ref pParkedOrderAction, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqOrderAction(IntPtr api, ref CThostFtdcInputOrderActionField pInputOrderAction, int nRequestID);
		/// <summary>
		/// 报单操作请求
		/// </summary>
		public void ReqOrderAction(CThostFtdcInputOrderActionField pInputOrderAction, int nRequestID)
		{
			tReqOrderAction(_api, ref pInputOrderAction, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryMaxOrderVolume(IntPtr api, ref CThostFtdcQryMaxOrderVolumeField pQryMaxOrderVolume, int nRequestID);
		/// <summary>
		/// 查询最大报单数量请求
		/// </summary>
		public void ReqQryMaxOrderVolume(CThostFtdcQryMaxOrderVolumeField pQryMaxOrderVolume, int nRequestID)
		{
			tReqQryMaxOrderVolume(_api, ref pQryMaxOrderVolume, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqSettlementInfoConfirm(IntPtr api, ref CThostFtdcSettlementInfoConfirmField pSettlementInfoConfirm, int nRequestID);
		/// <summary>
		/// 投资者结算结果确认
		/// </summary>
		public void ReqSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField pSettlementInfoConfirm, int nRequestID)
		{
			tReqSettlementInfoConfirm(_api, ref pSettlementInfoConfirm, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqRemoveParkedOrder(IntPtr api, ref CThostFtdcRemoveParkedOrderField pRemoveParkedOrder, int nRequestID);
		/// <summary>
		/// 请求删除预埋单
		/// </summary>
		public void ReqRemoveParkedOrder(CThostFtdcRemoveParkedOrderField pRemoveParkedOrder, int nRequestID)
		{
			tReqRemoveParkedOrder(_api, ref pRemoveParkedOrder, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqRemoveParkedOrderAction(IntPtr api, ref CThostFtdcRemoveParkedOrderActionField pRemoveParkedOrderAction, int nRequestID);
		/// <summary>
		/// 请求删除预埋撤单
		/// </summary>
		public void ReqRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField pRemoveParkedOrderAction, int nRequestID)
		{
			tReqRemoveParkedOrderAction(_api, ref pRemoveParkedOrderAction, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqExecOrderInsert(IntPtr api, ref CThostFtdcInputExecOrderField pInputExecOrder, int nRequestID);
		/// <summary>
		/// 执行宣告录入请求
		/// </summary>
		public void ReqExecOrderInsert(CThostFtdcInputExecOrderField pInputExecOrder, int nRequestID)
		{
			tReqExecOrderInsert(_api, ref pInputExecOrder, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqExecOrderAction(IntPtr api, ref CThostFtdcInputExecOrderActionField pInputExecOrderAction, int nRequestID);
		/// <summary>
		/// 执行宣告操作请求
		/// </summary>
		public void ReqExecOrderAction(CThostFtdcInputExecOrderActionField pInputExecOrderAction, int nRequestID)
		{
			tReqExecOrderAction(_api, ref pInputExecOrderAction, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqForQuoteInsert(IntPtr api, ref CThostFtdcInputForQuoteField pInputForQuote, int nRequestID);
		/// <summary>
		/// 询价录入请求
		/// </summary>
		public void ReqForQuoteInsert(CThostFtdcInputForQuoteField pInputForQuote, int nRequestID)
		{
			tReqForQuoteInsert(_api, ref pInputForQuote, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQuoteInsert(IntPtr api, ref CThostFtdcInputQuoteField pInputQuote, int nRequestID);
		/// <summary>
		/// 报价录入请求
		/// </summary>
		public void ReqQuoteInsert(CThostFtdcInputQuoteField pInputQuote, int nRequestID)
		{
			tReqQuoteInsert(_api, ref pInputQuote, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQuoteAction(IntPtr api, ref CThostFtdcInputQuoteActionField pInputQuoteAction, int nRequestID);
		/// <summary>
		/// 报价操作请求
		/// </summary>
		public void ReqQuoteAction(CThostFtdcInputQuoteActionField pInputQuoteAction, int nRequestID)
		{
			tReqQuoteAction(_api, ref pInputQuoteAction, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqBatchOrderAction(IntPtr api, ref CThostFtdcInputBatchOrderActionField pInputBatchOrderAction, int nRequestID);
		/// <summary>
		/// 批量报单操作请求
		/// </summary>
		public void ReqBatchOrderAction(CThostFtdcInputBatchOrderActionField pInputBatchOrderAction, int nRequestID)
		{
			tReqBatchOrderAction(_api, ref pInputBatchOrderAction, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqOptionSelfCloseInsert(IntPtr api, ref CThostFtdcInputOptionSelfCloseField pInputOptionSelfClose, int nRequestID);
		/// <summary>
		/// 期权自对冲录入请求
		/// </summary>
		public void ReqOptionSelfCloseInsert(CThostFtdcInputOptionSelfCloseField pInputOptionSelfClose, int nRequestID)
		{
			tReqOptionSelfCloseInsert(_api, ref pInputOptionSelfClose, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqOptionSelfCloseAction(IntPtr api, ref CThostFtdcInputOptionSelfCloseActionField pInputOptionSelfCloseAction, int nRequestID);
		/// <summary>
		/// 期权自对冲操作请求
		/// </summary>
		public void ReqOptionSelfCloseAction(CThostFtdcInputOptionSelfCloseActionField pInputOptionSelfCloseAction, int nRequestID)
		{
			tReqOptionSelfCloseAction(_api, ref pInputOptionSelfCloseAction, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqCombActionInsert(IntPtr api, ref CThostFtdcInputCombActionField pInputCombAction, int nRequestID);
		/// <summary>
		/// 申请组合录入请求
		/// </summary>
		public void ReqCombActionInsert(CThostFtdcInputCombActionField pInputCombAction, int nRequestID)
		{
			tReqCombActionInsert(_api, ref pInputCombAction, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryOrder(IntPtr api, ref CThostFtdcQryOrderField pQryOrder, int nRequestID);
		/// <summary>
		/// 请求查询报单
		/// </summary>
		public void ReqQryOrder(CThostFtdcQryOrderField pQryOrder, int nRequestID)
		{
			tReqQryOrder(_api, ref pQryOrder, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryTrade(IntPtr api, ref CThostFtdcQryTradeField pQryTrade, int nRequestID);
		/// <summary>
		/// 请求查询成交
		/// </summary>
		public void ReqQryTrade(CThostFtdcQryTradeField pQryTrade, int nRequestID)
		{
			tReqQryTrade(_api, ref pQryTrade, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryInvestorPosition(IntPtr api, ref CThostFtdcQryInvestorPositionField pQryInvestorPosition, int nRequestID);
		/// <summary>
		/// 请求查询投资者持仓
		/// </summary>
		public void ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField pQryInvestorPosition, int nRequestID)
		{
			tReqQryInvestorPosition(_api, ref pQryInvestorPosition, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryTradingAccount(IntPtr api, ref CThostFtdcQryTradingAccountField pQryTradingAccount, int nRequestID);
		/// <summary>
		/// 请求查询资金账户
		/// </summary>
		public void ReqQryTradingAccount(CThostFtdcQryTradingAccountField pQryTradingAccount, int nRequestID)
		{
			tReqQryTradingAccount(_api, ref pQryTradingAccount, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryInvestor(IntPtr api, ref CThostFtdcQryInvestorField pQryInvestor, int nRequestID);
		/// <summary>
		/// 请求查询投资者
		/// </summary>
		public void ReqQryInvestor(CThostFtdcQryInvestorField pQryInvestor, int nRequestID)
		{
			tReqQryInvestor(_api, ref pQryInvestor, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryTradingCode(IntPtr api, ref CThostFtdcQryTradingCodeField pQryTradingCode, int nRequestID);
		/// <summary>
		/// 请求查询交易编码
		/// </summary>
		public void ReqQryTradingCode(CThostFtdcQryTradingCodeField pQryTradingCode, int nRequestID)
		{
			tReqQryTradingCode(_api, ref pQryTradingCode, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryInstrumentMarginRate(IntPtr api, ref CThostFtdcQryInstrumentMarginRateField pQryInstrumentMarginRate, int nRequestID);
		/// <summary>
		/// 请求查询合约保证金率
		/// </summary>
		public void ReqQryInstrumentMarginRate(CThostFtdcQryInstrumentMarginRateField pQryInstrumentMarginRate, int nRequestID)
		{
			tReqQryInstrumentMarginRate(_api, ref pQryInstrumentMarginRate, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryInstrumentCommissionRate(IntPtr api, ref CThostFtdcQryInstrumentCommissionRateField pQryInstrumentCommissionRate, int nRequestID);
		/// <summary>
		/// 请求查询合约手续费率
		/// </summary>
		public void ReqQryInstrumentCommissionRate(CThostFtdcQryInstrumentCommissionRateField pQryInstrumentCommissionRate, int nRequestID)
		{
			tReqQryInstrumentCommissionRate(_api, ref pQryInstrumentCommissionRate, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryExchange(IntPtr api, ref CThostFtdcQryExchangeField pQryExchange, int nRequestID);
		/// <summary>
		/// 请求查询交易所
		/// </summary>
		public void ReqQryExchange(CThostFtdcQryExchangeField pQryExchange, int nRequestID)
		{
			tReqQryExchange(_api, ref pQryExchange, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryProduct(IntPtr api, ref CThostFtdcQryProductField pQryProduct, int nRequestID);
		/// <summary>
		/// 请求查询产品
		/// </summary>
		public void ReqQryProduct(CThostFtdcQryProductField pQryProduct, int nRequestID)
		{
			tReqQryProduct(_api, ref pQryProduct, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryInstrument(IntPtr api, ref CThostFtdcQryInstrumentField pQryInstrument, int nRequestID);
		/// <summary>
		/// 请求查询合约
		/// </summary>
		public void ReqQryInstrument(CThostFtdcQryInstrumentField pQryInstrument, int nRequestID)
		{
			tReqQryInstrument(_api, ref pQryInstrument, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryDepthMarketData(IntPtr api, ref CThostFtdcQryDepthMarketDataField pQryDepthMarketData, int nRequestID);
		/// <summary>
		/// 请求查询行情
		/// </summary>
		public void ReqQryDepthMarketData(CThostFtdcQryDepthMarketDataField pQryDepthMarketData, int nRequestID)
		{
			tReqQryDepthMarketData(_api, ref pQryDepthMarketData, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryTraderOffer(IntPtr api, ref CThostFtdcQryTraderOfferField pQryTraderOffer, int nRequestID);
		/// <summary>
		/// 请求查询交易员报盘机
		/// </summary>
		public void ReqQryTraderOffer(CThostFtdcQryTraderOfferField pQryTraderOffer, int nRequestID)
		{
			tReqQryTraderOffer(_api, ref pQryTraderOffer, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQrySettlementInfo(IntPtr api, ref CThostFtdcQrySettlementInfoField pQrySettlementInfo, int nRequestID);
		/// <summary>
		/// 请求查询投资者结算结果
		/// </summary>
		public void ReqQrySettlementInfo(CThostFtdcQrySettlementInfoField pQrySettlementInfo, int nRequestID)
		{
			tReqQrySettlementInfo(_api, ref pQrySettlementInfo, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryTransferBank(IntPtr api, ref CThostFtdcQryTransferBankField pQryTransferBank, int nRequestID);
		/// <summary>
		/// 请求查询转帐银行
		/// </summary>
		public void ReqQryTransferBank(CThostFtdcQryTransferBankField pQryTransferBank, int nRequestID)
		{
			tReqQryTransferBank(_api, ref pQryTransferBank, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryInvestorPositionDetail(IntPtr api, ref CThostFtdcQryInvestorPositionDetailField pQryInvestorPositionDetail, int nRequestID);
		/// <summary>
		/// 请求查询投资者持仓明细
		/// </summary>
		public void ReqQryInvestorPositionDetail(CThostFtdcQryInvestorPositionDetailField pQryInvestorPositionDetail, int nRequestID)
		{
			tReqQryInvestorPositionDetail(_api, ref pQryInvestorPositionDetail, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryNotice(IntPtr api, ref CThostFtdcQryNoticeField pQryNotice, int nRequestID);
		/// <summary>
		/// 请求查询客户通知
		/// </summary>
		public void ReqQryNotice(CThostFtdcQryNoticeField pQryNotice, int nRequestID)
		{
			tReqQryNotice(_api, ref pQryNotice, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQrySettlementInfoConfirm(IntPtr api, ref CThostFtdcQrySettlementInfoConfirmField pQrySettlementInfoConfirm, int nRequestID);
		/// <summary>
		/// 请求查询结算信息确认
		/// </summary>
		public void ReqQrySettlementInfoConfirm(CThostFtdcQrySettlementInfoConfirmField pQrySettlementInfoConfirm, int nRequestID)
		{
			tReqQrySettlementInfoConfirm(_api, ref pQrySettlementInfoConfirm, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryInvestorPositionCombineDetail(IntPtr api, ref CThostFtdcQryInvestorPositionCombineDetailField pQryInvestorPositionCombineDetail, int nRequestID);
		/// <summary>
		/// 请求查询投资者持仓明细
		/// </summary>
		public void ReqQryInvestorPositionCombineDetail(CThostFtdcQryInvestorPositionCombineDetailField pQryInvestorPositionCombineDetail, int nRequestID)
		{
			tReqQryInvestorPositionCombineDetail(_api, ref pQryInvestorPositionCombineDetail, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryCFMMCTradingAccountKey(IntPtr api, ref CThostFtdcQryCFMMCTradingAccountKeyField pQryCFMMCTradingAccountKey, int nRequestID);
		/// <summary>
		/// 请求查询保证金监管系统经纪公司资金账户密钥
		/// </summary>
		public void ReqQryCFMMCTradingAccountKey(CThostFtdcQryCFMMCTradingAccountKeyField pQryCFMMCTradingAccountKey, int nRequestID)
		{
			tReqQryCFMMCTradingAccountKey(_api, ref pQryCFMMCTradingAccountKey, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryEWarrantOffset(IntPtr api, ref CThostFtdcQryEWarrantOffsetField pQryEWarrantOffset, int nRequestID);
		/// <summary>
		/// 请求查询仓单折抵信息
		/// </summary>
		public void ReqQryEWarrantOffset(CThostFtdcQryEWarrantOffsetField pQryEWarrantOffset, int nRequestID)
		{
			tReqQryEWarrantOffset(_api, ref pQryEWarrantOffset, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryInvestorProductGroupMargin(IntPtr api, ref CThostFtdcQryInvestorProductGroupMarginField pQryInvestorProductGroupMargin, int nRequestID);
		/// <summary>
		/// 请求查询投资者品种/跨品种保证金
		/// </summary>
		public void ReqQryInvestorProductGroupMargin(CThostFtdcQryInvestorProductGroupMarginField pQryInvestorProductGroupMargin, int nRequestID)
		{
			tReqQryInvestorProductGroupMargin(_api, ref pQryInvestorProductGroupMargin, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryExchangeMarginRate(IntPtr api, ref CThostFtdcQryExchangeMarginRateField pQryExchangeMarginRate, int nRequestID);
		/// <summary>
		/// 请求查询交易所保证金率
		/// </summary>
		public void ReqQryExchangeMarginRate(CThostFtdcQryExchangeMarginRateField pQryExchangeMarginRate, int nRequestID)
		{
			tReqQryExchangeMarginRate(_api, ref pQryExchangeMarginRate, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryExchangeMarginRateAdjust(IntPtr api, ref CThostFtdcQryExchangeMarginRateAdjustField pQryExchangeMarginRateAdjust, int nRequestID);
		/// <summary>
		/// 请求查询交易所调整保证金率
		/// </summary>
		public void ReqQryExchangeMarginRateAdjust(CThostFtdcQryExchangeMarginRateAdjustField pQryExchangeMarginRateAdjust, int nRequestID)
		{
			tReqQryExchangeMarginRateAdjust(_api, ref pQryExchangeMarginRateAdjust, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryExchangeRate(IntPtr api, ref CThostFtdcQryExchangeRateField pQryExchangeRate, int nRequestID);
		/// <summary>
		/// 请求查询汇率
		/// </summary>
		public void ReqQryExchangeRate(CThostFtdcQryExchangeRateField pQryExchangeRate, int nRequestID)
		{
			tReqQryExchangeRate(_api, ref pQryExchangeRate, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQrySecAgentACIDMap(IntPtr api, ref CThostFtdcQrySecAgentACIDMapField pQrySecAgentACIDMap, int nRequestID);
		/// <summary>
		/// 请求查询二级代理操作员银期权限
		/// </summary>
		public void ReqQrySecAgentACIDMap(CThostFtdcQrySecAgentACIDMapField pQrySecAgentACIDMap, int nRequestID)
		{
			tReqQrySecAgentACIDMap(_api, ref pQrySecAgentACIDMap, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryProductExchRate(IntPtr api, ref CThostFtdcQryProductExchRateField pQryProductExchRate, int nRequestID);
		/// <summary>
		/// 请求查询产品报价汇率
		/// </summary>
		public void ReqQryProductExchRate(CThostFtdcQryProductExchRateField pQryProductExchRate, int nRequestID)
		{
			tReqQryProductExchRate(_api, ref pQryProductExchRate, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryProductGroup(IntPtr api, ref CThostFtdcQryProductGroupField pQryProductGroup, int nRequestID);
		/// <summary>
		/// 请求查询产品组
		/// </summary>
		public void ReqQryProductGroup(CThostFtdcQryProductGroupField pQryProductGroup, int nRequestID)
		{
			tReqQryProductGroup(_api, ref pQryProductGroup, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryMMInstrumentCommissionRate(IntPtr api, ref CThostFtdcQryMMInstrumentCommissionRateField pQryMMInstrumentCommissionRate, int nRequestID);
		/// <summary>
		/// 请求查询做市商合约手续费率
		/// </summary>
		public void ReqQryMMInstrumentCommissionRate(CThostFtdcQryMMInstrumentCommissionRateField pQryMMInstrumentCommissionRate, int nRequestID)
		{
			tReqQryMMInstrumentCommissionRate(_api, ref pQryMMInstrumentCommissionRate, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryMMOptionInstrCommRate(IntPtr api, ref CThostFtdcQryMMOptionInstrCommRateField pQryMMOptionInstrCommRate, int nRequestID);
		/// <summary>
		/// 请求查询做市商期权合约手续费
		/// </summary>
		public void ReqQryMMOptionInstrCommRate(CThostFtdcQryMMOptionInstrCommRateField pQryMMOptionInstrCommRate, int nRequestID)
		{
			tReqQryMMOptionInstrCommRate(_api, ref pQryMMOptionInstrCommRate, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryInstrumentOrderCommRate(IntPtr api, ref CThostFtdcQryInstrumentOrderCommRateField pQryInstrumentOrderCommRate, int nRequestID);
		/// <summary>
		/// 请求查询报单手续费
		/// </summary>
		public void ReqQryInstrumentOrderCommRate(CThostFtdcQryInstrumentOrderCommRateField pQryInstrumentOrderCommRate, int nRequestID)
		{
			tReqQryInstrumentOrderCommRate(_api, ref pQryInstrumentOrderCommRate, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQrySecAgentTradingAccount(IntPtr api, ref CThostFtdcQryTradingAccountField pQryTradingAccount, int nRequestID);
		/// <summary>
		/// 请求查询资金账户
		/// </summary>
		public void ReqQrySecAgentTradingAccount(CThostFtdcQryTradingAccountField pQryTradingAccount, int nRequestID)
		{
			tReqQrySecAgentTradingAccount(_api, ref pQryTradingAccount, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQrySecAgentCheckMode(IntPtr api, ref CThostFtdcQrySecAgentCheckModeField pQrySecAgentCheckMode, int nRequestID);
		/// <summary>
		/// 请求查询二级代理商资金校验模式
		/// </summary>
		public void ReqQrySecAgentCheckMode(CThostFtdcQrySecAgentCheckModeField pQrySecAgentCheckMode, int nRequestID)
		{
			tReqQrySecAgentCheckMode(_api, ref pQrySecAgentCheckMode, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQrySecAgentTradeInfo(IntPtr api, ref CThostFtdcQrySecAgentTradeInfoField pQrySecAgentTradeInfo, int nRequestID);
		/// <summary>
		/// 请求查询二级代理商信息
		/// </summary>
		public void ReqQrySecAgentTradeInfo(CThostFtdcQrySecAgentTradeInfoField pQrySecAgentTradeInfo, int nRequestID)
		{
			tReqQrySecAgentTradeInfo(_api, ref pQrySecAgentTradeInfo, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryOptionInstrTradeCost(IntPtr api, ref CThostFtdcQryOptionInstrTradeCostField pQryOptionInstrTradeCost, int nRequestID);
		/// <summary>
		/// 请求查询期权交易成本
		/// </summary>
		public void ReqQryOptionInstrTradeCost(CThostFtdcQryOptionInstrTradeCostField pQryOptionInstrTradeCost, int nRequestID)
		{
			tReqQryOptionInstrTradeCost(_api, ref pQryOptionInstrTradeCost, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryOptionInstrCommRate(IntPtr api, ref CThostFtdcQryOptionInstrCommRateField pQryOptionInstrCommRate, int nRequestID);
		/// <summary>
		/// 请求查询期权合约手续费
		/// </summary>
		public void ReqQryOptionInstrCommRate(CThostFtdcQryOptionInstrCommRateField pQryOptionInstrCommRate, int nRequestID)
		{
			tReqQryOptionInstrCommRate(_api, ref pQryOptionInstrCommRate, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryExecOrder(IntPtr api, ref CThostFtdcQryExecOrderField pQryExecOrder, int nRequestID);
		/// <summary>
		/// 请求查询执行宣告
		/// </summary>
		public void ReqQryExecOrder(CThostFtdcQryExecOrderField pQryExecOrder, int nRequestID)
		{
			tReqQryExecOrder(_api, ref pQryExecOrder, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryForQuote(IntPtr api, ref CThostFtdcQryForQuoteField pQryForQuote, int nRequestID);
		/// <summary>
		/// 请求查询询价
		/// </summary>
		public void ReqQryForQuote(CThostFtdcQryForQuoteField pQryForQuote, int nRequestID)
		{
			tReqQryForQuote(_api, ref pQryForQuote, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryQuote(IntPtr api, ref CThostFtdcQryQuoteField pQryQuote, int nRequestID);
		/// <summary>
		/// 请求查询报价
		/// </summary>
		public void ReqQryQuote(CThostFtdcQryQuoteField pQryQuote, int nRequestID)
		{
			tReqQryQuote(_api, ref pQryQuote, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryOptionSelfClose(IntPtr api, ref CThostFtdcQryOptionSelfCloseField pQryOptionSelfClose, int nRequestID);
		/// <summary>
		/// 请求查询期权自对冲
		/// </summary>
		public void ReqQryOptionSelfClose(CThostFtdcQryOptionSelfCloseField pQryOptionSelfClose, int nRequestID)
		{
			tReqQryOptionSelfClose(_api, ref pQryOptionSelfClose, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryInvestUnit(IntPtr api, ref CThostFtdcQryInvestUnitField pQryInvestUnit, int nRequestID);
		/// <summary>
		/// 请求查询投资单元
		/// </summary>
		public void ReqQryInvestUnit(CThostFtdcQryInvestUnitField pQryInvestUnit, int nRequestID)
		{
			tReqQryInvestUnit(_api, ref pQryInvestUnit, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryCombInstrumentGuard(IntPtr api, ref CThostFtdcQryCombInstrumentGuardField pQryCombInstrumentGuard, int nRequestID);
		/// <summary>
		/// 请求查询组合合约安全系数
		/// </summary>
		public void ReqQryCombInstrumentGuard(CThostFtdcQryCombInstrumentGuardField pQryCombInstrumentGuard, int nRequestID)
		{
			tReqQryCombInstrumentGuard(_api, ref pQryCombInstrumentGuard, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryCombAction(IntPtr api, ref CThostFtdcQryCombActionField pQryCombAction, int nRequestID);
		/// <summary>
		/// 请求查询申请组合
		/// </summary>
		public void ReqQryCombAction(CThostFtdcQryCombActionField pQryCombAction, int nRequestID)
		{
			tReqQryCombAction(_api, ref pQryCombAction, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryTransferSerial(IntPtr api, ref CThostFtdcQryTransferSerialField pQryTransferSerial, int nRequestID);
		/// <summary>
		/// 请求查询转帐流水
		/// </summary>
		public void ReqQryTransferSerial(CThostFtdcQryTransferSerialField pQryTransferSerial, int nRequestID)
		{
			tReqQryTransferSerial(_api, ref pQryTransferSerial, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryAccountregister(IntPtr api, ref CThostFtdcQryAccountregisterField pQryAccountregister, int nRequestID);
		/// <summary>
		/// 请求查询银期签约关系
		/// </summary>
		public void ReqQryAccountregister(CThostFtdcQryAccountregisterField pQryAccountregister, int nRequestID)
		{
			tReqQryAccountregister(_api, ref pQryAccountregister, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryContractBank(IntPtr api, ref CThostFtdcQryContractBankField pQryContractBank, int nRequestID);
		/// <summary>
		/// 请求查询签约银行
		/// </summary>
		public void ReqQryContractBank(CThostFtdcQryContractBankField pQryContractBank, int nRequestID)
		{
			tReqQryContractBank(_api, ref pQryContractBank, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryParkedOrder(IntPtr api, ref CThostFtdcQryParkedOrderField pQryParkedOrder, int nRequestID);
		/// <summary>
		/// 请求查询预埋单
		/// </summary>
		public void ReqQryParkedOrder(CThostFtdcQryParkedOrderField pQryParkedOrder, int nRequestID)
		{
			tReqQryParkedOrder(_api, ref pQryParkedOrder, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryParkedOrderAction(IntPtr api, ref CThostFtdcQryParkedOrderActionField pQryParkedOrderAction, int nRequestID);
		/// <summary>
		/// 请求查询预埋撤单
		/// </summary>
		public void ReqQryParkedOrderAction(CThostFtdcQryParkedOrderActionField pQryParkedOrderAction, int nRequestID)
		{
			tReqQryParkedOrderAction(_api, ref pQryParkedOrderAction, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryTradingNotice(IntPtr api, ref CThostFtdcQryTradingNoticeField pQryTradingNotice, int nRequestID);
		/// <summary>
		/// 请求查询交易通知
		/// </summary>
		public void ReqQryTradingNotice(CThostFtdcQryTradingNoticeField pQryTradingNotice, int nRequestID)
		{
			tReqQryTradingNotice(_api, ref pQryTradingNotice, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryBrokerTradingParams(IntPtr api, ref CThostFtdcQryBrokerTradingParamsField pQryBrokerTradingParams, int nRequestID);
		/// <summary>
		/// 请求查询经纪公司交易参数
		/// </summary>
		public void ReqQryBrokerTradingParams(CThostFtdcQryBrokerTradingParamsField pQryBrokerTradingParams, int nRequestID)
		{
			tReqQryBrokerTradingParams(_api, ref pQryBrokerTradingParams, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryBrokerTradingAlgos(IntPtr api, ref CThostFtdcQryBrokerTradingAlgosField pQryBrokerTradingAlgos, int nRequestID);
		/// <summary>
		/// 请求查询经纪公司交易算法
		/// </summary>
		public void ReqQryBrokerTradingAlgos(CThostFtdcQryBrokerTradingAlgosField pQryBrokerTradingAlgos, int nRequestID)
		{
			tReqQryBrokerTradingAlgos(_api, ref pQryBrokerTradingAlgos, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQueryCFMMCTradingAccountToken(IntPtr api, ref CThostFtdcQueryCFMMCTradingAccountTokenField pQueryCFMMCTradingAccountToken, int nRequestID);
		/// <summary>
		/// 请求查询监控中心用户令牌
		/// </summary>
		public void ReqQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField pQueryCFMMCTradingAccountToken, int nRequestID)
		{
			tReqQueryCFMMCTradingAccountToken(_api, ref pQueryCFMMCTradingAccountToken, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqFromBankToFutureByFuture(IntPtr api, ref CThostFtdcReqTransferField pReqTransfer, int nRequestID);
		/// <summary>
		/// 期货发起银行资金转期货请求
		/// </summary>
		public void ReqFromBankToFutureByFuture(CThostFtdcReqTransferField pReqTransfer, int nRequestID)
		{
			tReqFromBankToFutureByFuture(_api, ref pReqTransfer, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqFromFutureToBankByFuture(IntPtr api, ref CThostFtdcReqTransferField pReqTransfer, int nRequestID);
		/// <summary>
		/// 期货发起期货资金转银行请求
		/// </summary>
		public void ReqFromFutureToBankByFuture(CThostFtdcReqTransferField pReqTransfer, int nRequestID)
		{
			tReqFromFutureToBankByFuture(_api, ref pReqTransfer, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQueryBankAccountMoneyByFuture(IntPtr api, ref CThostFtdcReqQueryAccountField pReqQueryAccount, int nRequestID);
		/// <summary>
		/// 期货发起查询银行余额请求
		/// </summary>
		public void ReqQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField pReqQueryAccount, int nRequestID)
		{
			tReqQueryBankAccountMoneyByFuture(_api, ref pReqQueryAccount, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryClassifiedInstrument(IntPtr api, ref CThostFtdcQryClassifiedInstrumentField pQryClassifiedInstrument, int nRequestID);
		/// <summary>
		/// 请求查询分类合约
		/// </summary>
		public void ReqQryClassifiedInstrument(CThostFtdcQryClassifiedInstrumentField pQryClassifiedInstrument, int nRequestID)
		{
			tReqQryClassifiedInstrument(_api, ref pQryClassifiedInstrument, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryCombPromotionParam(IntPtr api, ref CThostFtdcQryCombPromotionParamField pQryCombPromotionParam, int nRequestID);
		/// <summary>
		/// 请求组合优惠比例
		/// </summary>
		public void ReqQryCombPromotionParam(CThostFtdcQryCombPromotionParamField pQryCombPromotionParam, int nRequestID)
		{
			tReqQryCombPromotionParam(_api, ref pQryCombPromotionParam, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryRiskSettleInvstPosition(IntPtr api, ref CThostFtdcQryRiskSettleInvstPositionField pQryRiskSettleInvstPosition, int nRequestID);
		/// <summary>
		/// 投资者风险结算持仓查询
		/// </summary>
		public void ReqQryRiskSettleInvstPosition(CThostFtdcQryRiskSettleInvstPositionField pQryRiskSettleInvstPosition, int nRequestID)
		{
			tReqQryRiskSettleInvstPosition(_api, ref pQryRiskSettleInvstPosition, nRequestID);
		}
		
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tReqQryRiskSettleProductStatus(IntPtr api, ref CThostFtdcQryRiskSettleProductStatusField pQryRiskSettleProductStatus, int nRequestID);
		/// <summary>
		/// 风险结算产品查询
		/// </summary>
		public void ReqQryRiskSettleProductStatus(CThostFtdcQryRiskSettleProductStatusField pQryRiskSettleProductStatus, int nRequestID)
		{
			tReqQryRiskSettleProductStatus(_api, ref pQryRiskSettleProductStatus, nRequestID);
		}
		

		#region 注册响应函数
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleFrontConnected();
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnFrontConnected(IntPtr spi, deleFrontConnected func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleFrontDisconnected(int nReason);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnFrontDisconnected(IntPtr spi, deleFrontDisconnected func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleHeartBeatWarning(int nTimeLapse);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnHeartBeatWarning(IntPtr spi, deleHeartBeatWarning func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspAuthenticate(IntPtr  pRspAuthenticateField, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspAuthenticate(IntPtr spi, deleRspAuthenticate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspUserLogin(IntPtr  pRspUserLogin, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspUserLogin(IntPtr spi, deleRspUserLogin func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspUserLogout(IntPtr  pUserLogout, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspUserLogout(IntPtr spi, deleRspUserLogout func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspUserPasswordUpdate(IntPtr  pUserPasswordUpdate, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspUserPasswordUpdate(IntPtr spi, deleRspUserPasswordUpdate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspTradingAccountPasswordUpdate(IntPtr  pTradingAccountPasswordUpdate, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspTradingAccountPasswordUpdate(IntPtr spi, deleRspTradingAccountPasswordUpdate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspUserAuthMethod(IntPtr  pRspUserAuthMethod, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspUserAuthMethod(IntPtr spi, deleRspUserAuthMethod func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspGenUserCaptcha(IntPtr  pRspGenUserCaptcha, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspGenUserCaptcha(IntPtr spi, deleRspGenUserCaptcha func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspGenUserText(IntPtr  pRspGenUserText, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspGenUserText(IntPtr spi, deleRspGenUserText func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspOrderInsert(IntPtr  pInputOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspOrderInsert(IntPtr spi, deleRspOrderInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspParkedOrderInsert(IntPtr  pParkedOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspParkedOrderInsert(IntPtr spi, deleRspParkedOrderInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspParkedOrderAction(IntPtr  pParkedOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspParkedOrderAction(IntPtr spi, deleRspParkedOrderAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspOrderAction(IntPtr  pInputOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspOrderAction(IntPtr spi, deleRspOrderAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryMaxOrderVolume(IntPtr  pQryMaxOrderVolume, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryMaxOrderVolume(IntPtr spi, deleRspQryMaxOrderVolume func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspSettlementInfoConfirm(IntPtr  pSettlementInfoConfirm, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspSettlementInfoConfirm(IntPtr spi, deleRspSettlementInfoConfirm func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspRemoveParkedOrder(IntPtr  pRemoveParkedOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspRemoveParkedOrder(IntPtr spi, deleRspRemoveParkedOrder func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspRemoveParkedOrderAction(IntPtr  pRemoveParkedOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspRemoveParkedOrderAction(IntPtr spi, deleRspRemoveParkedOrderAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspExecOrderInsert(IntPtr  pInputExecOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspExecOrderInsert(IntPtr spi, deleRspExecOrderInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspExecOrderAction(IntPtr  pInputExecOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspExecOrderAction(IntPtr spi, deleRspExecOrderAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspForQuoteInsert(IntPtr  pInputForQuote, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspForQuoteInsert(IntPtr spi, deleRspForQuoteInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQuoteInsert(IntPtr  pInputQuote, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQuoteInsert(IntPtr spi, deleRspQuoteInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQuoteAction(IntPtr  pInputQuoteAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQuoteAction(IntPtr spi, deleRspQuoteAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspBatchOrderAction(IntPtr  pInputBatchOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspBatchOrderAction(IntPtr spi, deleRspBatchOrderAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspOptionSelfCloseInsert(IntPtr  pInputOptionSelfClose, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspOptionSelfCloseInsert(IntPtr spi, deleRspOptionSelfCloseInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspOptionSelfCloseAction(IntPtr  pInputOptionSelfCloseAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspOptionSelfCloseAction(IntPtr spi, deleRspOptionSelfCloseAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspCombActionInsert(IntPtr  pInputCombAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspCombActionInsert(IntPtr spi, deleRspCombActionInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryOrder(IntPtr  pOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryOrder(IntPtr spi, deleRspQryOrder func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryTrade(IntPtr  pTrade, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryTrade(IntPtr spi, deleRspQryTrade func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryInvestorPosition(IntPtr  pInvestorPosition, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryInvestorPosition(IntPtr spi, deleRspQryInvestorPosition func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryTradingAccount(IntPtr  pTradingAccount, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryTradingAccount(IntPtr spi, deleRspQryTradingAccount func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryInvestor(IntPtr  pInvestor, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryInvestor(IntPtr spi, deleRspQryInvestor func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryTradingCode(IntPtr  pTradingCode, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryTradingCode(IntPtr spi, deleRspQryTradingCode func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryInstrumentMarginRate(IntPtr  pInstrumentMarginRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryInstrumentMarginRate(IntPtr spi, deleRspQryInstrumentMarginRate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryInstrumentCommissionRate(IntPtr  pInstrumentCommissionRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryInstrumentCommissionRate(IntPtr spi, deleRspQryInstrumentCommissionRate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryExchange(IntPtr  pExchange, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryExchange(IntPtr spi, deleRspQryExchange func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryProduct(IntPtr  pProduct, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryProduct(IntPtr spi, deleRspQryProduct func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryInstrument(IntPtr  pInstrument, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryInstrument(IntPtr spi, deleRspQryInstrument func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryDepthMarketData(IntPtr  pDepthMarketData, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryDepthMarketData(IntPtr spi, deleRspQryDepthMarketData func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryTraderOffer(IntPtr  pTraderOffer, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryTraderOffer(IntPtr spi, deleRspQryTraderOffer func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQrySettlementInfo(IntPtr  pSettlementInfo, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQrySettlementInfo(IntPtr spi, deleRspQrySettlementInfo func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryTransferBank(IntPtr  pTransferBank, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryTransferBank(IntPtr spi, deleRspQryTransferBank func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryInvestorPositionDetail(IntPtr  pInvestorPositionDetail, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryInvestorPositionDetail(IntPtr spi, deleRspQryInvestorPositionDetail func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryNotice(IntPtr  pNotice, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryNotice(IntPtr spi, deleRspQryNotice func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQrySettlementInfoConfirm(IntPtr  pSettlementInfoConfirm, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQrySettlementInfoConfirm(IntPtr spi, deleRspQrySettlementInfoConfirm func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryInvestorPositionCombineDetail(IntPtr  pInvestorPositionCombineDetail, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryInvestorPositionCombineDetail(IntPtr spi, deleRspQryInvestorPositionCombineDetail func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryCFMMCTradingAccountKey(IntPtr  pCFMMCTradingAccountKey, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryCFMMCTradingAccountKey(IntPtr spi, deleRspQryCFMMCTradingAccountKey func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryEWarrantOffset(IntPtr  pEWarrantOffset, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryEWarrantOffset(IntPtr spi, deleRspQryEWarrantOffset func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryInvestorProductGroupMargin(IntPtr  pInvestorProductGroupMargin, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryInvestorProductGroupMargin(IntPtr spi, deleRspQryInvestorProductGroupMargin func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryExchangeMarginRate(IntPtr  pExchangeMarginRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryExchangeMarginRate(IntPtr spi, deleRspQryExchangeMarginRate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryExchangeMarginRateAdjust(IntPtr  pExchangeMarginRateAdjust, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryExchangeMarginRateAdjust(IntPtr spi, deleRspQryExchangeMarginRateAdjust func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryExchangeRate(IntPtr  pExchangeRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryExchangeRate(IntPtr spi, deleRspQryExchangeRate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQrySecAgentACIDMap(IntPtr  pSecAgentACIDMap, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQrySecAgentACIDMap(IntPtr spi, deleRspQrySecAgentACIDMap func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryProductExchRate(IntPtr  pProductExchRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryProductExchRate(IntPtr spi, deleRspQryProductExchRate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryProductGroup(IntPtr  pProductGroup, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryProductGroup(IntPtr spi, deleRspQryProductGroup func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryMMInstrumentCommissionRate(IntPtr  pMMInstrumentCommissionRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryMMInstrumentCommissionRate(IntPtr spi, deleRspQryMMInstrumentCommissionRate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryMMOptionInstrCommRate(IntPtr  pMMOptionInstrCommRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryMMOptionInstrCommRate(IntPtr spi, deleRspQryMMOptionInstrCommRate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryInstrumentOrderCommRate(IntPtr  pInstrumentOrderCommRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryInstrumentOrderCommRate(IntPtr spi, deleRspQryInstrumentOrderCommRate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQrySecAgentTradingAccount(IntPtr  pTradingAccount, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQrySecAgentTradingAccount(IntPtr spi, deleRspQrySecAgentTradingAccount func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQrySecAgentCheckMode(IntPtr  pSecAgentCheckMode, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQrySecAgentCheckMode(IntPtr spi, deleRspQrySecAgentCheckMode func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQrySecAgentTradeInfo(IntPtr  pSecAgentTradeInfo, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQrySecAgentTradeInfo(IntPtr spi, deleRspQrySecAgentTradeInfo func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryOptionInstrTradeCost(IntPtr  pOptionInstrTradeCost, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryOptionInstrTradeCost(IntPtr spi, deleRspQryOptionInstrTradeCost func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryOptionInstrCommRate(IntPtr  pOptionInstrCommRate, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryOptionInstrCommRate(IntPtr spi, deleRspQryOptionInstrCommRate func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryExecOrder(IntPtr  pExecOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryExecOrder(IntPtr spi, deleRspQryExecOrder func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryForQuote(IntPtr  pForQuote, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryForQuote(IntPtr spi, deleRspQryForQuote func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryQuote(IntPtr  pQuote, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryQuote(IntPtr spi, deleRspQryQuote func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryOptionSelfClose(IntPtr  pOptionSelfClose, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryOptionSelfClose(IntPtr spi, deleRspQryOptionSelfClose func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryInvestUnit(IntPtr  pInvestUnit, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryInvestUnit(IntPtr spi, deleRspQryInvestUnit func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryCombInstrumentGuard(IntPtr  pCombInstrumentGuard, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryCombInstrumentGuard(IntPtr spi, deleRspQryCombInstrumentGuard func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryCombAction(IntPtr  pCombAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryCombAction(IntPtr spi, deleRspQryCombAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryTransferSerial(IntPtr  pTransferSerial, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryTransferSerial(IntPtr spi, deleRspQryTransferSerial func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryAccountregister(IntPtr  pAccountregister, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryAccountregister(IntPtr spi, deleRspQryAccountregister func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspError(IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspError(IntPtr spi, deleRspError func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnOrder(IntPtr  pOrder);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnOrder(IntPtr spi, deleRtnOrder func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnTrade(IntPtr  pTrade);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnTrade(IntPtr spi, deleRtnTrade func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnOrderInsert(IntPtr  pInputOrder, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnOrderInsert(IntPtr spi, deleErrRtnOrderInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnOrderAction(IntPtr  pOrderAction, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnOrderAction(IntPtr spi, deleErrRtnOrderAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnInstrumentStatus(IntPtr  pInstrumentStatus);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnInstrumentStatus(IntPtr spi, deleRtnInstrumentStatus func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnBulletin(IntPtr  pBulletin);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnBulletin(IntPtr spi, deleRtnBulletin func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnTradingNotice(IntPtr  pTradingNoticeInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnTradingNotice(IntPtr spi, deleRtnTradingNotice func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnErrorConditionalOrder(IntPtr  pErrorConditionalOrder);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnErrorConditionalOrder(IntPtr spi, deleRtnErrorConditionalOrder func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnExecOrder(IntPtr  pExecOrder);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnExecOrder(IntPtr spi, deleRtnExecOrder func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnExecOrderInsert(IntPtr  pInputExecOrder, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnExecOrderInsert(IntPtr spi, deleErrRtnExecOrderInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnExecOrderAction(IntPtr  pExecOrderAction, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnExecOrderAction(IntPtr spi, deleErrRtnExecOrderAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnForQuoteInsert(IntPtr  pInputForQuote, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnForQuoteInsert(IntPtr spi, deleErrRtnForQuoteInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnQuote(IntPtr  pQuote);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnQuote(IntPtr spi, deleRtnQuote func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnQuoteInsert(IntPtr  pInputQuote, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnQuoteInsert(IntPtr spi, deleErrRtnQuoteInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnQuoteAction(IntPtr  pQuoteAction, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnQuoteAction(IntPtr spi, deleErrRtnQuoteAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnForQuoteRsp(IntPtr  pForQuoteRsp);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnForQuoteRsp(IntPtr spi, deleRtnForQuoteRsp func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnCFMMCTradingAccountToken(IntPtr  pCFMMCTradingAccountToken);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnCFMMCTradingAccountToken(IntPtr spi, deleRtnCFMMCTradingAccountToken func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnBatchOrderAction(IntPtr  pBatchOrderAction, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnBatchOrderAction(IntPtr spi, deleErrRtnBatchOrderAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnOptionSelfClose(IntPtr  pOptionSelfClose);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnOptionSelfClose(IntPtr spi, deleRtnOptionSelfClose func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnOptionSelfCloseInsert(IntPtr  pInputOptionSelfClose, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnOptionSelfCloseInsert(IntPtr spi, deleErrRtnOptionSelfCloseInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnOptionSelfCloseAction(IntPtr  pOptionSelfCloseAction, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnOptionSelfCloseAction(IntPtr spi, deleErrRtnOptionSelfCloseAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnCombAction(IntPtr  pCombAction);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnCombAction(IntPtr spi, deleRtnCombAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnCombActionInsert(IntPtr  pInputCombAction, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnCombActionInsert(IntPtr spi, deleErrRtnCombActionInsert func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryContractBank(IntPtr  pContractBank, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryContractBank(IntPtr spi, deleRspQryContractBank func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryParkedOrder(IntPtr  pParkedOrder, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryParkedOrder(IntPtr spi, deleRspQryParkedOrder func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryParkedOrderAction(IntPtr  pParkedOrderAction, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryParkedOrderAction(IntPtr spi, deleRspQryParkedOrderAction func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryTradingNotice(IntPtr  pTradingNotice, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryTradingNotice(IntPtr spi, deleRspQryTradingNotice func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryBrokerTradingParams(IntPtr  pBrokerTradingParams, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryBrokerTradingParams(IntPtr spi, deleRspQryBrokerTradingParams func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryBrokerTradingAlgos(IntPtr  pBrokerTradingAlgos, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryBrokerTradingAlgos(IntPtr spi, deleRspQryBrokerTradingAlgos func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQueryCFMMCTradingAccountToken(IntPtr  pQueryCFMMCTradingAccountToken, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQueryCFMMCTradingAccountToken(IntPtr spi, deleRspQueryCFMMCTradingAccountToken func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnFromBankToFutureByBank(IntPtr  pRspTransfer);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnFromBankToFutureByBank(IntPtr spi, deleRtnFromBankToFutureByBank func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnFromFutureToBankByBank(IntPtr  pRspTransfer);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnFromFutureToBankByBank(IntPtr spi, deleRtnFromFutureToBankByBank func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnRepealFromBankToFutureByBank(IntPtr  pRspRepeal);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnRepealFromBankToFutureByBank(IntPtr spi, deleRtnRepealFromBankToFutureByBank func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnRepealFromFutureToBankByBank(IntPtr  pRspRepeal);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnRepealFromFutureToBankByBank(IntPtr spi, deleRtnRepealFromFutureToBankByBank func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnFromBankToFutureByFuture(IntPtr  pRspTransfer);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnFromBankToFutureByFuture(IntPtr spi, deleRtnFromBankToFutureByFuture func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnFromFutureToBankByFuture(IntPtr  pRspTransfer);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnFromFutureToBankByFuture(IntPtr spi, deleRtnFromFutureToBankByFuture func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnRepealFromBankToFutureByFutureManual(IntPtr  pRspRepeal);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnRepealFromBankToFutureByFutureManual(IntPtr spi, deleRtnRepealFromBankToFutureByFutureManual func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnRepealFromFutureToBankByFutureManual(IntPtr  pRspRepeal);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnRepealFromFutureToBankByFutureManual(IntPtr spi, deleRtnRepealFromFutureToBankByFutureManual func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnQueryBankBalanceByFuture(IntPtr  pNotifyQueryAccount);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnQueryBankBalanceByFuture(IntPtr spi, deleRtnQueryBankBalanceByFuture func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnBankToFutureByFuture(IntPtr  pReqTransfer, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnBankToFutureByFuture(IntPtr spi, deleErrRtnBankToFutureByFuture func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnFutureToBankByFuture(IntPtr  pReqTransfer, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnFutureToBankByFuture(IntPtr spi, deleErrRtnFutureToBankByFuture func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnRepealBankToFutureByFutureManual(IntPtr  pReqRepeal, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnRepealBankToFutureByFutureManual(IntPtr spi, deleErrRtnRepealBankToFutureByFutureManual func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnRepealFutureToBankByFutureManual(IntPtr  pReqRepeal, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnRepealFutureToBankByFutureManual(IntPtr spi, deleErrRtnRepealFutureToBankByFutureManual func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleErrRtnQueryBankBalanceByFuture(IntPtr  pReqQueryAccount, IntPtr  pRspInfo);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnErrRtnQueryBankBalanceByFuture(IntPtr spi, deleErrRtnQueryBankBalanceByFuture func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnRepealFromBankToFutureByFuture(IntPtr  pRspRepeal);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnRepealFromBankToFutureByFuture(IntPtr spi, deleRtnRepealFromBankToFutureByFuture func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnRepealFromFutureToBankByFuture(IntPtr  pRspRepeal);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnRepealFromFutureToBankByFuture(IntPtr spi, deleRtnRepealFromFutureToBankByFuture func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspFromBankToFutureByFuture(IntPtr  pReqTransfer, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspFromBankToFutureByFuture(IntPtr spi, deleRspFromBankToFutureByFuture func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspFromFutureToBankByFuture(IntPtr  pReqTransfer, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspFromFutureToBankByFuture(IntPtr spi, deleRspFromFutureToBankByFuture func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQueryBankAccountMoneyByFuture(IntPtr  pReqQueryAccount, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQueryBankAccountMoneyByFuture(IntPtr spi, deleRspQueryBankAccountMoneyByFuture func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnOpenAccountByBank(IntPtr  pOpenAccount);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnOpenAccountByBank(IntPtr spi, deleRtnOpenAccountByBank func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnCancelAccountByBank(IntPtr  pCancelAccount);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnCancelAccountByBank(IntPtr spi, deleRtnCancelAccountByBank func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRtnChangeAccountByBank(IntPtr  pChangeAccount);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRtnChangeAccountByBank(IntPtr spi, deleRtnChangeAccountByBank func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryClassifiedInstrument(IntPtr  pInstrument, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryClassifiedInstrument(IntPtr spi, deleRspQryClassifiedInstrument func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryCombPromotionParam(IntPtr  pCombPromotionParam, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryCombPromotionParam(IntPtr spi, deleRspQryCombPromotionParam func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryRiskSettleInvstPosition(IntPtr  pRiskSettleInvstPosition, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryRiskSettleInvstPosition(IntPtr spi, deleRspQryRiskSettleInvstPosition func);
		
		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
		private delegate void deleRspQryRiskSettleProductStatus(IntPtr  pRiskSettleProductStatus, IntPtr  pRspInfo, int nRequestID, bool bIsLast);
		[DllImport("ctp_trade.dll", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr tSetOnRspQryRiskSettleProductStatus(IntPtr spi, deleRspQryRiskSettleProductStatus func);
		
		#endregion
	}
}